Model in a modal window in angularjs is empty

Try to change the

  • $scope.testField

into

  • $scope.myModel.testField (or user.firstName…)

As mentioned in this video angular JS – best practice (29:19):

“Whenever you have ng-model there’s gotta be a dot in there somewhere. If you don’t have a dot, you’re doing it wrong.”

See updated plunker http://plnkr.co/edit/z1ABPEUB7Nxm1Kxey9iv?p=preview

NOTE: with a nice reminder of the video-minute from article Nested Scopes in Angular JS

Leave a Comment