<input type="range">
<!-- Add your site or application content here -->
<div class="container" ng-view></div>
<script src="components/angular/angular.js"></script>
<script src="components/underscore/underscore.js"></script>
$routeProvider
.when('/', {
templateUrl: 'views/main.html',
controller: 'MainCtrl'
})
.when('/contact/:id', {
redirectTo: '/contact/:id/view'
})
angular.module('workshop2App')
.controller('ContactViewCtrl',
function ($scope, $routeParams, contacts) {
$scope.contact = contacts.get($routeParams.id);
$scope.id = $routeParams.id;
});
angular.module('workshop2App')
.factory('contacts', function () {
var exampleContacts = [ ... ];
// Public API here
return {
getAll: function () {
return exampleContacts;
},
get: function (id) {}
var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
// => [2, 4, 6]
var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
// => 6
_.isString(object)
_.isNumber(object)
<p></p>
<p>Output: </p>
<tr ng-repeat="friend in friends | filter:searchText">
</tr>
angular.module('workshop2App')
.filter('filterName', function () {
return function (input, arg1, arg2) {
return 'between filter: ' + input;
};
});
<li ng-repeat="element in list | filterName:value1:value2">
var array = [1, 2, 3];
angular.forEach(array, function(value){
this.push('Value: ' + value);
});
<span my-dir="exp"></span>
<span class="my-dir: exp;"></span>
<my-dir></my-dir>
<!-- directive: my-dir exp -->