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 has been archived by the owner on Sep 5, 2024. It is now read-only.
This is because $mdCompiler modifies the source object and gets confused if it receives the same object again later. Treating the options object as immutable would solve the issue at a very small performance cost (copying properties).
I will try to submit a pull request this weekend.
The text was updated successfully, but these errors were encountered:
In my case it's an overlay service which we built as part of our own UI framework which is using angular-material core for utilities. When creating a new instance, it takes options which are then reused every time you call show on the that instance and it's currently hidden. It is functionally similar to $$interimElement.
While I can (and did) just clone the options on every show, it is missing the point: modifying an object passed as parameter to a function is bad practice when it would be unexpected (if the purpose of the function is not explicitly mutation of the object).
Also, it should be up to the caller whether or not the callee is called multiple times, not the callee (unless there is a compelling reason to prevent it).
@rochdev - Totally agree that the failure point (weakness) needs to be resolved. My earlier question was simply wondering why you were having scenarios with multiple calls. $mdCompiler should not maintain state, no force expectations on the caller to protect itself.
This is because
$mdCompiler
modifies the source object and gets confused if it receives the same object again later. Treating the options object as immutable would solve the issue at a very small performance cost (copying properties).I will try to submit a pull request this weekend.
The text was updated successfully, but these errors were encountered: