Closed MikaAK closed 9 years ago
Yes, this is for zero-config compatibility with both $scope
-style controllers and controllerAs
(#4) controllers.
You can turn off binding to the $scope
(this.$
) by setting the addToScope
option to false.
myApp.classy.options.controller = {
bindData: {
addToScope: false
}
}
You can't currently prevent binding to this
but I think that's a reasonable feature request so I will add it to Classy sometime this week.
This is now fixed in master.
Example Usage:
angular.module('app').classy.options.controller = {
bindData: {
addToClass: false
}
}
Recently I noticed that data that has been assigned via the
data: {}
property will not only get put onthis.$
but also onthis
. Assigning properties viathis.$.myProp = { a: 1, b: 2}
only inserts them on scope and doesn't put them onto thethis
object of the controller.