You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Do you want to request a feature or report a bug?
Bug, I guess ?
What is the current behavior?
$routeProvider deep-copies its route object in the beginning of the when('...', route) call, which is a heavy way of solving #8181 and #9731.
What is the expected behavior?
Handle routes without needing a deep-copy.
What is the motivation / use case for changing the behavior?
I'm trying to plumb the Closure goog.html types in Angular as an alternative to the $sce types. These rely on a private marker that is passed to each instance by builders to ensure other classes can't fake them, and the deep copy breaks that link when passing an instance of that type in templateUrl.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Recent ones ? That was initially fixed in b477058 .
Other information (e.g. stacktraces, related issues, suggestions how to fix)
I think this issue can be worked around by replacing templateUrl : safeTypeInstance with templateUrl : function(){return safeTypeInstance;}, but that's ugly. Martin Probst asked us to write an issue, saying "deep copying the entire object seems overkill if all you wanted was to (shallow) copy the fields in the angular.extend call.".
The text was updated successfully, but these errors were encountered:
Thanks for the report. The issue seems pretty minor, but if there's an easy solution that fixes it, we can merge it in. Do you want to open a PR for this?
Deep-copying route definition objects can break specific custom implementations of `$sce` (used to
trust a `templateUrl` as RESOURCE_URL). The purpose of copying route definition objects was to guard
against the user's modifying the route definition object after route registration, while still
capturing inherited properties.
As suggested by @IgorMinar in #14699 (comment),
we can achieve both _and_ support custom `$sce` implementations, by shallow-copying instead.
This is an alternative implementation for #14699, which avoids the breaking change.
Fixes#14478Closes#14699Closes#14750
Do you want to request a feature or report a bug?
Bug, I guess ?
What is the current behavior?
$routeProvider deep-copies its route object in the beginning of the when('...', route) call, which is a heavy way of solving #8181 and #9731.
What is the expected behavior?
Handle routes without needing a deep-copy.
What is the motivation / use case for changing the behavior?
I'm trying to plumb the Closure goog.html types in Angular as an alternative to the $sce types. These rely on a private marker that is passed to each instance by builders to ensure other classes can't fake them, and the deep copy breaks that link when passing an instance of that type in templateUrl.
Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
Recent ones ? That was initially fixed in b477058 .
Other information (e.g. stacktraces, related issues, suggestions how to fix)
I think this issue can be worked around by replacing templateUrl : safeTypeInstance with templateUrl : function(){return safeTypeInstance;}, but that's ugly. Martin Probst asked us to write an issue, saying "deep copying the entire object seems overkill if all you wanted was to (shallow) copy the fields in the angular.extend call.".
The text was updated successfully, but these errors were encountered: