Skip to content

Instantly share code, notes, and snippets.

@allenyang79
Created August 29, 2013 09:31
Show Gist options
  • Save allenyang79/6376065 to your computer and use it in GitHub Desktop.
Save allenyang79/6376065 to your computer and use it in GitHub Desktop.
angularjs簡單測試
<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>
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