You can customize/create filter as per your requirement. You have to configure that filter into configuration module.
You just need to add below code in controller.js (this is just for demo purpose) file and add one line in app.js file from previous example.
controller.js
/* Define Filter */
var appFilter = angular.module('appFilter',[]).filter('checkmark',function(){
return function(input){
return input? '\u2713':'\u2718';
};
});
app.js
var configModule = angular.module('configModule',[
'ngRoute',
'phoneDetailModule',
'phoneListModule',
'appFilter'
]);
configModule.config(['$routeProvider',function($routeProvider){
$routeProvider.
when('/phones',{
templateUrl: 'Partials/PhoneDetail.html',
controller: 'PhoneDetailController'
}).
when('/phones/:phoneId',{
templateUrl: 'Partials/PhoneList.html',
controller: 'PhoneListController'
}).
otherwise({
redirectTo: '/phones'
});
}]);
No comments:
Post a Comment