niedziela, 13 października 2013

AngularJS tutorial - my problems and solutions

Due to the fact that AngularJS gaining wider group of supporters and I decided to become familiar with its capabilities. So I started from AngularJS tutorial. At first I had to install: node.js, karma, git I already had (went smoothly). Step 0, Step 1 and almost finished Step 2 if no Section Tests, with whom I had a few problems - we are happy to share them, because maybe some of my suggestions will benefit and save some time. Let me just mention that I am acting in a Windows environment.

Step 0, 1 success

Step 2 problems

Problem #1
The node.js console show me wrong path to Chrome: I set it at: Of course, best to add it directly to the system environment variables.

Problem #2
In file D:\angular-phonecat\test\unit\controllersSpec.js test code lines were too much, I cut it to what follows:
Problem #3
I received a warning about the lack of food karma-junit-reporter so I installed what you need:
Step 2 success

Step 3, 4 success
In step 3, there were no problems, keep it up. However impressed me test end-to-end tool Angular Scenario Runner. Really great. I must admit that so far has not happened to me to make any test in JavaScript (shame) may hence the rapture.
In step 4, very plainly explained by the binding of a model to the user interface and the user interface to the model (two-way data-binding) on the example of sorting.

Step 5, 6 problems

Problem #1
When you run the example in the browser did not show the data (phones). So I looked at the console (Developer Tools), and there is an error: The code controllers.js was: It should be (for the tutorial is OK, and the lack GitHub):
Step 5, 6, 7, 8, 9 success
In step 5, and finally found out the use of AJAX, and in step 6 displayed the pictures (thumbnails) phones. Step 7 was much more interesting, I learned to do a lot of views (phone lists, detail phone) and routing.
In step 8 views phone-detail.html and finally gained the contents, the application consists of two full view. I also wrote in the Experiments, the first test e2e: Step 9 went smoothly, I know as I write my own filters.

Step 10, 11 problems

Problem #1
When I run the example in the browser did not show the content (white page), the JavaScript console error occurred: In app.js code was: Should be:
Step 10, 11, 12 success
Step 10 and I know how to handle the event. In step 11, I learned how to pick up AJAX to data on the server by creating your own website. In the last 12-step animations - perfect for the end of the tutorial.

Both the framework and its AngularJS tutorial made ​​quite an impression on me. I would recommend.