Last active
August 29, 2015 14:05
-
-
Save yszou/1ed2d1c9bd7076a6bfcf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>angularjs</title> | |
<script src="http://cdn.staticfile.org/jquery/2.1.0/jquery.min.js" type="text/javascript"></script> | |
<script src="http://cdn.staticfile.org/angular.js/1.0.8/angular.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<form name="test_form" ng-controller="TestCtrl" ng-init="o=[0,1,2,3]; a=o[1];"> | |
<select ng-model="a" ng-options="x for x in o" ng-change="show()"> | |
<option value="">可以加这个空值</option> | |
</select> | |
</form> | |
<script type="text/javascript"> | |
var TestCtrl = function($scope){ | |
$scope.show = function(){ | |
console.log($scope.a); | |
} | |
} | |
angular.bootstrap(document.documentElement); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment