var demoApp = angular.module('demoApp', ['ngRoute']);
demoApp.factory = ('simpleFactory', function () {
var factory = {};
var customers = [{ name: 'Touqeer', city: 'Multan' },
{ name: 'Arslan', city: 'RWP' },
{ name: 'Saleem', city: 'Taxila' }];``
factory.getCustomers = function () {
return customers;`enter code here`
};
return factory;
});
demoApp.controller('SimpleController', function ($scope, simpleFactory) {
debugger
$scope.customers = simpleFactory.getCustomers();
});
Error It shows : Error: [$injector:unpr] http://errors.angularjs.org/1.2.14/$injector/unpr?p0=simpleFactoryProvider%20%3C-impleFactory at Error (native)