Hello š! Thanks for subscribing.
Published on: 2021-04-27
tags: Lab, Angular, TypeScript
Iām learning Angular right now ā as a React.js fangirl.
Pluralsight offers a free month of learning in April. Iām taking advantage of it.
Here are some notes on the course Angular Services by Brice Wilson.
@Injectable
decoratorProvider
requiredExample Service:
@Injectable
export class SomeService {
// some methods
}
Providing a Service:
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule],
bootstrap: [AppComponent],
providers: [SomeService],
})
export class AppModule {}
@Injectable({providedIn: 'root'})
is tree-shakableThe course offers several demos that help you understand how Angular services work. Those are really useful, but I cannot include them here.
Thank you for reading my blog posts.