Jamie Barker
Jamie Barker

Reputation: 183

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 :)

Upvotes: 0

Views: 1652

Answers (1)

Jamie Barker
Jamie Barker

Reputation: 183

Fixed! :) i Had

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

which messes up the scope variable, duh!

Upvotes: 1

Related Questions