New to Angular and I'm trying to follow JSLint ( written by Douglas Crockford ) recommendation of not using this
in JS at all.
How can I prevent myself to use this
in Angular? All the tutorials I've seen so far rely on using this
and SO search had resulted in no answer.
For the purpose of being clear, let's assume I'm trying to write this controller:
app.controller('StoreController', function() {
this.products = {};
});
How can I access the controller object so I can add the products
property?
var my_controller = app.controller('StoreController', function() {
});
my_controller.products = {}; // Maybe like this?