Hi,
I don't understand this in the Angular sample app (e.g. in "Creating the PhoneBook Component" and on many other pages of the sample App):
{{l("PhoneBook" | localize)}}
Why use the l() function and the localize pipe? Surely they are two different ways of doing the same thing and don't need to be used together? There is also an example of this in the framework in "theme-selection-panel.component.html" Also can you explain the difference between the two methods of localization? Why did you introduce the pipe? Should I change my app to use the pipe method everywhere?
Thanks.
5 Answer(s)
-
0
This is a mistake in the documentation, I will update it. You can use the localize pipeline directly.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
https://github.com/aspnetzero/documents/pull/135
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks. There is also an example of this in the framework in "theme-selection-panel.component.html" Also can you explain the difference between the two methods of localization? Why did you introduce the pipe? Should I change my app to use the pipe method everywhere?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
https://github.com/aspnetzero/aspnet-zero-core/commit/cd01dd93178a82b807a32f26beb78e7169686356 already fixed
The zero angular localize pipeline is used more.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
1
Also can you explain the difference between the two methods of localization? Why did you introduce the pipe?
localizepipe was introduced to prevent calling localization every time Angular runs change detection, possibly [on] every mouse move on the container component.See aspnetzero/aspnet-zero-core#2001.
Should I change my app to use the pipe method everywhere?
Yes, it is recommended.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)