Angular Talk
by Soviut
HTML
<div ng-app="App">
<div ng-controller="MainCtrl">
<h1>Angular Sandbox</h1>
<p>{{ blah|uppercase }}</p>
<input type="text" ng-model="blah">
<input type="text" ng-model="blah">
</div>
</div>
CSS
body {
font-family: arial, helvetica, san-serif;
}
JavaScript
var app = angular.module('App', []);
app.controller('MainCtrl', function($scope, apiService) {
$scope.testing = 'ding';
apiService.getTime().then(function(data) {
console.log('data', data);
})
});
app.service('apiService', function($http) {
this.getTime = function() {
return $http.jsonp('http://json-time.appspot.com/time.json', {
params: {
callback: 'JSON_CALLBACK'
}
});
};
});
// app
// ng-model
// two-way binding
// controller
// scope variable
// template expression
// filters
// repeater on array
// add to array function on submit
// service
// http promise
// animations