标签:
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> <script src="scripts/angular.js"></script> </head> <body ng-app="app" ng-controller="cur"> how are you! <div> <input type="text" ng-model="name" /> {{name}} <button ng-click="pop(this)">pop</button> </div> <ul> <li ng-repeat="num in list">{{num}}</li> </ul> <select> <option ng-repeat="no in select" value="{{no}}">{{no}}</option> </select> <div ng-show="show()">ng show test</div> <div ng-show="show1">ng show test boolean</div> <script> var app = angular.module(‘app‘, []); app.controller(‘cur‘, function ($scope) { $scope.name = ‘test‘; $scope.list = [1, 2, 3, 4]; $scope.select = [4, 3, 2, 1]; $scope.pop = function (obj) { //alert(obj); alert($scope.name); } $scope.show = function () { return false; }; $scope.show1 = true; }); </script> </body> </html>
标签:
原文地址:http://www.cnblogs.com/hualiu0/p/5670280.html