You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import { Http } from '@angular/http';
import { StorageService } from '@shared/services';
@Injectable()
export class AuthService {
constructor(private http: Http, private storageService: StorageService) { ... }
}
typescript and webpack compiles and builds without erros, but I get an error in chrome that says
Can't resolve all parameters for AuthService: (Http, ?)
But if I write:
import { Http } from '@angular/http';
import { StorageService } from './storage.service';
@Injectable()
export class AuthService {
constructor(private http: Http, private storageService: StorageService) { ... }
}
it works.
AuthService and StorageService are in the same folder app/shared/services/ and there's an index.ts with export * from './storage.service'; in it, so this should work right?
Is there anything more I need to add to tsconfig.json or angular-cli.json to get it to work?
Activity
filipesilva commentedon Oct 10, 2016
Same as #1831. It's a circular dependency. Best way to avoid it is to not try to use the barrel file from inside that barrel.
tmansson commentedon Oct 11, 2016
You're right, don't think I would have found that on my own. Thanks! :)
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.