how can I create or inject a tree-shakable service? I cannot find any documentation about it, do you think it is correct like that?
@Injectable({
providedIn: 'root',
})
export class ExampleService {
}
import { ExampleService } from './example.service';
@Component({
selector: 'app-test',
template: ``,
providers: { provide: AuthService,useClass: AuthService}
})
export class MyComponent {
}
in terms o performance is more efficiently use providedIn
@Injectable({
providedIn: 'root',
})
or without providedIn
@Injectable
Thanks Andrea