ordercloud-api / angular-client

A repository containing the new npm package for angular v5.0+ (@ordercloud/angular-sdk)
MIT License
1 stars 0 forks source link

Implement tree-shakeable providers introduced in angular v6 #4

Closed crhistianramirez closed 5 years ago

crhistianramirez commented 6 years ago

https://blog.ninja-squad.com/2018/05/04/what-is-new-angular-6/

Basically by defining our services this way they will be tree shaken. Meaning if a consumer of this sdk doesn't include a service it won't be included in the bundle. In order to do this we'll need to add:

@Injectable({
  providedIn: 'root'
})
export class OcMeService{

}

above each service and then remove the explicit imports in api.module.ts: https://github.com/ordercloud-api/angular-client/blob/master/api.module.ts#L45-L79

crhistianramirez commented 5 years ago

resolved as of v0.0.1-25