Created
August 29, 2013 09:31
-
-
Save allenyang79/6376065 to your computer and use it in GitHub Desktop.
angularjs簡單測試
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
<html = ng-app="app"> | |
<body ng-controller="TextController"> | |
<p>{{someText.message}}</p> | |
<input type="checkbox" ng-model="foo"> | |
Starting: <input ng-change="computeNeeded()" ng-model="funding.startingEstimate"><br/> | |
Recommendation: {{funding.needed*funding.startingEstimate}}<br/> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script> | |
</body> | |
</html> |
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
var app = angular.module('app',[]); | |
app.controller('TextController', function($scope){ | |
var someText = {}; | |
someText.message = 'You have started your journey'; | |
$scope.funding={ | |
needed:1, | |
startingEstimate:10 | |
}; | |
$scope.foo=false; | |
$scope.someText = someText; | |
$scope.$watch('foo', function() { | |
//alert($scope.foo); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment