Open jim-coffey opened 8 years ago
In Chapter05 I fixed this just in the tasks.components.ts
adding the following providers line to the TasksComponent
@Component decorator :
providers: [provide(NgLocalization, { useClass: MessagesLocalization })]
Chapter04 issue initially
OK, so I've been using Angular
2.0.0-rc.4
so maybe these are my own fault, but the i18nPlural pipe filter doesn't work with the provided code.In order to make it work I had to do the following inside the
.ts
file :Import the NgLocalization provider
Extend the class to define a
getPluralCategory
method on itInject the extended provider in to the bootstrap, although I think you can also add it to the providers key of the component individually
Not sure if this area of angular2 just needs further development, or if this is the ideal fix going forward.
There are other angular2 plugins that can be used and injected to make the functionality work.