Angular Directive: After adding a directive I no longer see data from ng-model

时光毁灭记忆、已成空白 提交于 2019-12-11 19:12:57

问题


How would I get the data from email address or password? In my case I have a combo box with an ng-model="selectedObject" assigned to it. However in my controller, $scope.selectedObject does not contain any data. It doesn't seem to be bound. Also, this binding worked before I added the directive. Any ideas?

<modal title="Remove a Group" visible="showRemoveModal">
  <form name="form" class="form-horizontal" role="form">
    <div style="width:500px">
      <div class="form-group">
         <label class="control-label" for="Name">Name&nbsp;</label>
         <select ng-model="selectedGroupForDelete" ng-options="group.Name for group in groups" />
      </div>
    </div>
  </form>
  <div class="modal-footer">
    <a href="#" class="btn btn-primary" data-dismiss="modal" ng-click="deleteGroup()" ng-disabled="!selectedGroupForDelete">Remove</a>
    <a href="#" class="btn" data-dismiss="modal">Cancel</a>
  </div>
</modal>

Here is the link to a sample: http://jsfiddle.net/alexsuch/RLQhh/

来源:https://stackoverflow.com/questions/27406486/angular-directive-after-adding-a-directive-i-no-longer-see-data-from-ng-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!