Last active
August 29, 2015 14:08
-
-
Save nekman/62af5fbb762781d6be56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() | |
{ | |
var dependencies = [ | |
'myApp/model/Session', | |
'myApp/services/Authenticator', | |
'myApp/controllers/LoginController' | |
]; | |
define( dependencies, function( Session, Authenticator, LoginController ) | |
{ | |
angular | |
.factory( Session.name, Session.inject ) | |
.service( Authenticator.name, Authenticator.inject ) | |
.controller( LoginController.name, LoginController.inject ); | |
}); | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function() { | |
var Session = require('myApp/model/Session'), | |
Authenticator = require('myApp/services/Authenticator'); | |
var LoginController = function( session, authenticator ) { | |
// Publish instance with simple login() and logout() APIs | |
return { | |
login : function( userName, password ) { /***/ }, | |
logout : function() { /***/ }, | |
}; | |
}; | |
// Publish the constructor/construction array | |
return { | |
name: 'loginController', | |
inject: [ Session.name, Authenticator.name, LoginController ] | |
}; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment