-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Changed start/endsymbols (interpolateProvider) not used in templates #877
Comments
👍 |
@ajoslin - should we use |
Wouldn't it be safer (and less hackier) to use the actual symbols in the template ? |
@gkalpak - can you elaborate since I am I understand your point. |
We can use ng-bind and ng-bind-template everywhere instead of the symbols.
|
I might have missed something, but from a quick look it seems that the problem is that the dialog templates use This could be circumvented by using the actual symbols:
|
@ajoslin: |
@gkalpak - this is what I part of what I was originally proposing... Your latest suggestion IMO makes the markup very ponderous and forces manually concatenation of template segments. |
Note: not only the dialog template uses |
In fact many of our components markup use |
@ThomasBurleson: You are already doing concatenation of template segments, but my suggestion does indeed make the code less readable. There are ways to improve this of course (e.g. using I don't know how temporarily swapping the actual symbols with There could be a helper function that takes a template and replaces all |
@galpak: yes, or even appending a simple |
@josvos 👍 |
@josvos: That's what I meant by "using {{...}} and replacing all accurences with the actual symbols at the end". Of course, as there are templates in several places, this should be put into a helper service/function. |
@gkalpak - like the helper function idea also 👍 |
FYI Grepping the current master (44a3322), I found templates in the following files:
Toast could get away with Here is a fiddle showcasing the affected components. |
Previously, components specifying their own templates (such as dialog, toast) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. Closes angular#877 NOTE: This is still work-in-progress. It only fixes Toast. Still pending: * Dialog (alert, confirm) * TextField (seems to work as is, but...)
Previously, components specifying their own templates (such as dialog, toast) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. Closes angular#877 NOTE: This is still work-in-progress. It only fixes Toast. Still pending: * Dialog (alert, confirm) * TextField (seems to work as is, but...)
Previously, components specifying their own templates (such as dialog, toast) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. Closes angular#877 **NOTE:** This is still work-in-progress. It only fixes Toast. Still pending: * Dialog (alert, confirm) * TextField (seems to work as is, but...)
Previously, components specifying their own templates (such as dialog, toast) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. Closes angular#877 **NOTE:** This is still work-in-progress. It only fixes Toast. Still pending: * Dialog (alert, confirm) * TextField (seems to work as is, but...)
Previously, components specifying their own templates (such as dialog, toast) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. Closes angular#877 **NOTE:** This is still work-in-progress. It only fixes Toast. Still pending: * Dialog (alert, confirm) * TextField (seems to work as is, but...)
Previously, components specifying their own templates (such as dialog, toast etc) assumed that the interpolation start-/endSymbols where `{{`/`}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. **NOTE:** This is still work-in-progress. * Added `INTERPOLATION_SYMBOLS` property in `$mdConstant` with the default symbols used in templates. * Added `replaceInterpolationSymbols()` method in `$mdUtil` for replacing default symbols with actual. * Added tests for `$mdUtil.replaceInterpolationSymbols()`. * Updated `$mdToast` to use `replaceInterpolationSymbols()`. * Added tests for `$mdToast` with custom interpolation symbols. * Updated `$mdDialog` to use `replaceInterpolationSymbols()`. * Added tests for `$mdDialog` with custom interpolation symbols. * Find out why `mdTextFloatDirective` works as expected (although it seems that is shouldn't). * Update `mdTextFloatDirective` to use `replaceInterpolationSymbols()`. * Add tests for `mdTextFloatDirective` with custom interpolation symbols. Closes angular#877
Previously, components specifying their own templates (such as Dialog, Toast etc) assumed that the interpolation start-/endSymbols where `{{` and `}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. **NOTE:** This is still work-in-progress. ##### Already completed: * Added `INTERPOLATION_SYMBOLS` property in `$mdConstant` with the default symbols used in templates. * Added `replaceInterpolationSymbols()` method in `$mdUtil` for replacing default symbols with actual. * Added tests for `$mdUtil.replaceInterpolationSymbols()`. * Updated `$mdToast` to use `replaceInterpolationSymbols()`. * Added tests for `$mdToast` with custom interpolation symbols. * Updated `$mdDialog` to use `replaceInterpolationSymbols()`. * Added tests for `$mdDialog` with custom interpolation symbols. ##### Still pending: * Find out why `mdTextFloatDirective` works as expected (although it seems that is shouldn't). * Update `mdTextFloatDirective` to use `replaceInterpolationSymbols()`. * Add tests for `mdTextFloatDirective` with custom interpolation symbols. Closes angular#877
Previously, components specifying their own templates (such as Dialog, Toast etc) assumed that the interpolation start-/endSymbols where `{{` and `}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. **NOTE:** This is still work-in-progress. ##### Already completed: * Added `INTERPOLATION_SYMBOLS` property in `$mdConstant` with the default symbols used in templates. * Added `replaceInterpolationSymbols()` method in `$mdUtil` for replacing default symbols with actual. * Added tests for `$mdUtil.replaceInterpolationSymbols()`. * Updated `$mdToast` to use `replaceInterpolationSymbols()`. * Added tests for `$mdToast` with custom interpolation symbols. * Updated `$mdDialog` to use `replaceInterpolationSymbols()`. * Added tests for `$mdDialog` with custom interpolation symbols. ##### Still pending: * Find out why `mdTextFloatDirective` works as expected (although it seems that is shouldn't). * Update `mdTextFloatDirective` to use `replaceInterpolationSymbols()`. * Add tests for `mdTextFloatDirective` with custom interpolation symbols. Closes angular#877
@ThomasBurleson, @ajoslin: I have put together a PR implementing a fix for the templates: #887 It is still kind of WIP, but most of the work has been done. The actual code changes are pretty limited; most of the added code is tests. |
Previously, components specifying their own templates (such as Dialog, Toast etc) assumed that the interpolation start-/endSymbols where `{{` and `}}`, thus breaking in apps using custom symbols. This commit introduces a new `$mdUtil` method for replacing the "assumed" symbols (`{{`/`}}`) with the actual ones. **NOTE:** This is still work-in-progress. ##### Already completed: * Added `INTERPOLATION_SYMBOLS` property in `$mdConstant` with the default symbols used in templates. * Added `replaceInterpolationSymbols()` method in `$mdUtil` for replacing default symbols with actual. * Added tests for `$mdUtil.replaceInterpolationSymbols()`. * Updated `$mdToast` to use `replaceInterpolationSymbols()`. * Added tests for `$mdToast` with custom interpolation symbols. * Updated `$mdDialog` to use `replaceInterpolationSymbols()`. * Added tests for `$mdDialog` with custom interpolation symbols. ##### Still pending: * Find out why `mdTextFloatDirective` works as expected (although it seems that is shouldn't). * Update `mdTextFloatDirective` to use `replaceInterpolationSymbols()`. * Add tests for `mdTextFloatDirective` with custom interpolation symbols. Closes angular#877
When the application has changed the start/endsymbols (in my case I used
$interpolateProvider.startSymbol('{$').endSymbol('$}');
for that), some elements, like dialogs, are not working properly, as the default symbols{{
and}}
are hardcoded in the templates.The text was updated successfully, but these errors were encountered: