Answer the question
In order to leave comments, you need to log in
An elementary question about $scope and this in AngularJS, as well as the need to test the code?
Elementary question.
I am learning to work with AngularJS from the book "AngularJS Up & Running". Applied everywhere this.propertyName
Although in other examples, I often see the use of $scope controller injection and use it accordingly in the code.
I read that such changes since 1.2 version of AngularJS.
1) What to use?
And one more question, I want to immediately start writing tests using the Karma + Jasmine bundle. 2) How relevant is this now for production and how would you recommend learning testing, after mastering the basics of AngularJS or in the learning process?
Answer the question
In order to leave comments, you need to log in
The sooner you start and learn how to write tests, the better.
In the long run, tests, if they don’t save you time, will certainly save nerve cells.
this is used in conjunction with the controller as syntax, which can be handy if you're using nested controllers. Although personally, I think using data from parent controllers in templates is a very bad practice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question