Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* The to be imported module */
- angular
- .module('myModule', [])
- .factory('myFactory', function () {
- var setting = null;
- var myFactory = {
- initialize : initialize,
- action1 : action1,
- ...
- };
- return myFactory;
- function initialize(obj) {
- if (typeof setting == null) {
- setting = obj;
- }
- }
- });
- /* Main app */
- angular
- .module('myApp', ['myModule'])
- .app(function(myFactory) {
- myFactory.initialize(someFile);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement