ionic 使用AngularJS ng-model 實(shí)現(xiàn)數(shù)據(jù)雙向綁定
AngularJS 實(shí)例
綁定輸入框的值到 scope 變量中:
<div ng-app="myApp" ng-controller="myCtrl">
? ? ? <input ng-model="name">
</div> //輸入框綁定model
<script>
? ? ? ?var app = angular.module('myApp', []);
? ? ? ?app.controller('myCtrl',function($scope){
? ? ? ? ? ? $scope.name = "Bob";
? ? ? ? });
</script>
實(shí)現(xiàn)數(shù)據(jù)雙向綁定