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
Using version v1.1.11 of restmod, we tried to use a singleton model.
like so:
restmod.singleton(url,{// ...});
But this issues a warning Passing mixins and definitions in the model method will be deprecated in restmod 1.2, use restmod.model().mix() instead.
This is because the .singleton is only a shorthand that returns back to the normal model, that has the warning.
Sadly I could not get it to work with neither: restmod.singleton('url').mix({...}) nor restmod.model(null).single(url).mix({...}).
The documentation does not really state how to work with those, and also is not up to date regarding the deprecation warning.
Question:
How do I solve the deprecation within a singleton?
model: function(_baseUrl/* , _mix */){varmodel=buildModel(_baseUrl,BASE_CHAIN);if(arguments.length>1){model.mix(arraySlice.call(arguments,1));$log.warn('Passing mixins and definitions in the model method will be deprecated in restmod 1.2, use restmod.model().mix() instead.');}returnmodel;}
causing the warning. with arguments containing two elements:
the url
the mix Object
The text was updated successfully, but these errors were encountered:
For now, the best 'fix' for it would be to not use the singleton method and just call the methods yourselfs:
restmod.model().mix(...).single(url)
The singleton could should be rewritten to this. But due to the abandoned state of the library, I don't think this will ever happen. I don't know how many people actively use this library.
Using version v1.1.11 of restmod, we tried to use a singleton model.
like so:
But this issues a warning
Passing mixins and definitions in the model method will be deprecated in restmod 1.2, use restmod.model().mix() instead.
This is because the .singleton is only a shorthand that returns back to the normal model, that has the warning.
Sadly I could not get it to work with neither:
restmod.singleton('url').mix({...})
norrestmod.model(null).single(url).mix({...})
.The documentation does not really state how to work with those, and also is not up to date regarding the deprecation warning.
Question:
How do I solve the deprecation within a singleton?
Further code analysis
in
angular-restmod.js
line 178resolves to
angular-restmod.js
line 133causing the warning. with
arguments
containing two elements:The text was updated successfully, but these errors were encountered: