Jhonathan Howard Falcutela (Kaii)
Imaginative Dreamer & Hack Artist
specific style
domain style
var myModule = angular.module('myAngularApplication', []);Built in Directives in Angular
{{ myData | filter }}{{ myData | filter:'parameter' }}{{ myData | filter | yetAnotherFilter }}$scope.allCapsMessage = $filter("uppercase")($scope.message);$scope.conversionRate = $filter("number")(62.3, 5);angular.module('myAngularApplication').filter('power', function () {
return function (input, powerValue) {
// Check if power value is falsy
if (!powerValue) {
powerValue = 1;
}
// Use Math.pow to find the power and return it
return Math.pow(input, powerValue);
}
});(function () {
var remoteBooksService = function ($http) {
var _fetchBooks = function () {
return $http.get('http://localhost:80/api_url');
};
return {
fetchBooks: _fetchBooks
};
}
angular.module('myAngularApplication').factory('remoteBooksService',
["$http", remoteBooksService]);
}());myModule = angular.module('myAngularApplication', ['ngRoute']);myModule = angular.module('myAngularApplication', ['ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when("/home", {
templateUrl: "home.html",
controller: "homeController"
})
.when("/about", {
templateUrl: "about.html",
controller: "aboutController"
})
.when("/contact", {
templateUrl: "contact.html",
controller: "contactController"
}).
otherwise({
redirect: '/home'
});
}]);
By Jhonathan Howard Falcutela (Kaii)