Current Topic: 4.2.6.1. From Controller to Library
You have a privilege to create a quiz (QnA) related to this subject and obtain creativity score...
4.2.6.1. From Controller to Library
Angular Controllers with JS functions can grow substantially. How do we manage growing sources?
Of course, we create libraries.
Here is an extended example of the controller that we had in a previous section. This time we extended the controller with a state and a method - function to provide a full address. We increased the Controller code but minimized our HTML part.
Update text fields.
Street:
City:
State:
Zip:
Address: {{fullAddress()}}
frameborder="1" >
Let us move all controller code into an external file addressController.js. We will create this file in the js folder of the project and will copy the code between the script tags into the file
addressController.js
Was it clear so far? Highlight the text in question
Or
See how small the HTML file is:
Update text fields.
Street:
City:
State:
Zip:
Address: {{fullAddress()}}
frameborder="1" >
Assignments: 1. In the project 4.2.6.Angular add the file addressController.js to the js folder.
2. Create the file 4.2.6.angular5.html in the html folder and copy the HTML portion to this file.
3. Create another example in the HTML folder with another controller as a library file in the js folder.
4. Create 2 QnA related to the subject and send to dean@ituniversity.us
5. Learn the library for integrating movie clips with Angular:
https://github.com/moviemasher/angular-moviemasher
The library uses moviemasher.js to produce a mix of video clips, for example, with robots
Focus on Angular functions, increase the number of samples that you can create for QnAs and have handy for future interviews.
To make it really work, server side coding is needed. Existing samples of server side are available (so far) in PHP or RB (ruby).
We invite you to create your own questions and answers (QnA) to increase your rank and win the Top Creativity Prize!
Let us move all controller code into an external file addressController.js. We will create this file in the js folder of the project and will copy the code between the script tags into the file
addressController.js
Assignments: 1. In the project 4.2.6.Angular add the file addressController.js to the js folder.
2. Create the file 4.2.6.angular5.html in the html folder and copy the HTML portion to this file.
3. Create another example in the HTML folder with another controller as a library file in the js folder.
4. Create 2 QnA related to the subject and send to dean@ituniversity.us
5. Learn the library for integrating movie clips with Angular:
https://github.com/moviemasher/angular-moviemasher
The library uses moviemasher.js to produce a mix of video clips, for example, with robots
Focus on Angular functions, increase the number of samples that you can create for QnAs and have handy for future interviews.
To make it really work, server side coding is needed. Existing samples of server side are available (so far) in PHP or RB (ruby).
We invite you to create your own questions and answers (QnA) to increase your rank and win the Top Creativity Prize!