Created
March 28, 2016 18:46
-
-
Save tnewman/5621390e59017d62403c 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
// Angular 2: Configuring LoginService | |
@Injectable() class LoginService { | |
constructor(@Inject("LoginServiceConfig") public config: {url: string}) {} | |
//... | |
} | |
@Component({ | |
selector: 'app', | |
template: `<login></login>`, | |
directives: [Login], | |
providers: [ | |
LoginService, | |
provie("LoginServiceConfig", {useValue: {url: 'myurl'}) | |
] | |
}) | |
class App {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment