$scope doesn't picks up string from form input - AngularJS, JS

末鹿安然 提交于 2019-12-07 04:04:26

I believe this may be the case of prototypical inheritance and scope, requiring an object being passed into your scoped parameters. Mind trying to change your parent scope to use an object and bind to the properties and not the primitive values:

$scope.security = {newPassword : '', currentPassword = ''};

then you would use something like this in your attributes:

model="security.newPassword"

Or better yet, not make it confusing with model:

myapp-model="security.newPassword"

or pass in the whole object

myapp-security="security"

Working in this plunker template ?

<form ...>
  <form-row model="newPassword" name="New: " size="col-sm-8" required ></form-row>
  <form-row model="repeatedNewPassword" name="Repeat: " size="col-sm-8" required ></form-row>
  <form-row model="currentPassword" name="Current: " size="col-sm-8" required ></form-row>
</form>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!