Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tnewman/5621390e59017d62403c to your computer and use it in GitHub Desktop.
Save tnewman/5621390e59017d62403c to your computer and use it in GitHub Desktop.
// 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