Home create factory file separately in Angularjs
Reply: 0

create factory file separately in Angularjs

user752
1#
user752 Published in June 19, 2018, 2:42 pm

I am currently using factory in module.js file like this:

angular.module('bionCatalog', [])
    .component('bionCatalogManager', bionCatalogManager)
        .factory('FeedFactory', function() {
      const currency = '';
      const productFeed = {};
      const scheduleFeed = { 'name': '', 'schedule': productFeed };
      return scheduleFeed;
    } ) 
    .service('xxx', xxx)
    .config(config);

I need to somehow keep the factory function body in a separate file, so that it could be included in module.js file like this

 .factory('factoryname', factoryname)

where factoryname is a separate file as factoryname.factory.js

Any help would be appreciated.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.342919 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO