Notes for AngularJs compression and AngularJs Compression
AngularJS uses the parameter name of the controller constructor to infer the dependent service name. Therefore, if you want to compress the Controller's JS Code, all its parameters will be compressed at the same time. At this time, the dependency injection system cannot correctly identify the service.
Assume that the name of our Controller is BookCtrl, and the code before compression is:
Var BookCtrl = function ($ scope, $ http) {/* constructor body */};
To overcome the problems caused by compression, you only need to assign an array of dependent service identifiers to the $ inject attribute in the controller function:
BookCtrl. $ inject = ['$ scope', '$ http'];
Another method can also be used to specify the dependency list and avoid compression problems-use Javascript arrays to construct the controller: Put the service to be injected into a String Array (representing the dependency name, the last element of the array is the Controller's method function:
Var BookCtrl = ['$ scope', '$ http', function ($ scope, $ http) {/* constructor body */}];
The two methods mentioned above can work perfectly with any function that AngularJS can inject. Which method to choose depends entirely on the programming style of your project. We recommend that you use arrays.
Select echo of AngularJs
I don't know what your aa and some data formats are like. The following is a selected example:
<! DOCTYPE html>
Establish an AngularJS Environment
Pay attention to the following key areas,
1. Add ng-app
2. Introduce angularjs.
See angularjs.org/here for details.
<! Doctype html>