angularJS中的ng-click和ng-change
2015-08-25 15:35
603 查看
<!doctype html> <html ng-app="RadioExample"> <head> <meta charset="utf-8"> </head> <body> <div> <input ng-model="greeting.text"/> <p>{{greeting.text}},AngularJS</p> </div> <div> <form name="myForm" ng-controller="TestController"> <input ng-model="test" type="radio" value="0" ng-change="a()" /> 0 <input ng-model="test" type="radio" value="1" ng-change="a()"/> 1 </form> </div> </body> <script src="js/angular-1.3.0.js"></script> <script type="text/javascript" src="js/FuckController.js"></script> </html>
var testFuck = angular.module('RadioExample', []) .controller('TestController', ['$scope', function($scope) { $scope.a=function() { if ($scope.test == "1") { alert("1"); } if ($scope.test == "0") { alert("0"); } } }]);
以上代码纠结了好久,==晚上更新
相关文章推荐
- angularjs 入门编写
- ZH奶酪:AngularJS/JavaScript上传图片【PC端】
- AngularJs学习总结
- angularjs中动态为audio绑定src
- angular checkbox 全选和反选功能
- angularjs ng-repeat下验证问题
- Angular内置指令
- ionic + angularJS $ionicHistory接口文档
- 你知道用AngularJs怎么定义指令吗?
- angularjs 使用uploadify出现的问题总结
- angularjs Scopes
- 用angular来思考问题How do I “think in AngularJS” if I have a jQuery background?
- AngularJs $broadcast $emit $on 事件触发controller间的值传递
- AngularJS入门教程07:路由与多视图
- AngularJS入门教程06:链接与图片模板
- AngularJS入门教程05:XHR和依赖注入
- AngularJS入门教程04:双向绑定
- AngularJS入门教程03:迭代器
- AngularJS入门教程02:AngularJS模板
- AngularJS入门教程01:静态模板