简体   繁体   中英

Angular populate input fields

I have a object that gets populated via a restful API in my root scope and then in my child scope I'm trying to populate some input fields.

child controller

$scope.profileForm = $scope.$parent.student;

this works and I can

console.log($scope.profileForm.FirstName);

but the input on my page does not populate?

<input ng-model="profileForm.FirstName" type="text" class="form-control form-control-first" id="first-name-input" placeholder="FIRSTNAME" required />

Any help would be great :)

Fixed! :) i Had

<form name="profileForm" ... />

which messes up the scope variable, duh!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM