We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a auth service that I want to access to set some values in restangularInit
export function restangularInit(RestangularProvider, AuthService) { RestangularProvider.setBaseUrl('api'); RestangularProvider.setDefaultHeaders( {'Authorization': 'Bearer [replace this :) ]'}, ); }
can´t find out how to use my AuthService.. it just stays "undefined".. Any help is appreciated!
The text was updated successfully, but these errors were encountered:
More code to give a better context..
import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { HttpModule } from '@angular/http'; import { MaterialModule } from '@angular/material'; import { FlexLayoutModule } from "@angular/flex-layout"; import { RestangularModule } from 'ng2-restangular'; // Components import { AppComponent } from './app.component'; import { ProductComponent } from './components/product/product.component'; // Services import { AuthService } from './services/auth.service'; export function restangularInit(RestangularProvider, AuthService) { console.log(AuthService); RestangularProvider.setBaseUrl('api'); RestangularProvider.setDefaultHeaders( {'Authorization': 'Bearer d7b2e9f56a22646a22e1ee348ab2f85bdb967b56'}, ); } @NgModule({ declarations: [ AppComponent, ProductComponent ], imports: [ BrowserModule, FormsModule, HttpModule, MaterialModule, FlexLayoutModule, RestangularModule.forRoot(restangularInit) ], providers: [ AuthService ], entryComponents: [ProductComponent], bootstrap: [AppComponent] }) export class AppModule { }
Sorry, something went wrong.
No branches or pull requests
I have a auth service that I want to access to set some values in restangularInit
can´t find out how to use my AuthService.. it just stays "undefined"..
Any help is appreciated!
The text was updated successfully, but these errors were encountered: