1. TemplateURL and routes should be run under the web server.
2. Use the template replace to set true, and there must be corresponding labels in the template, otherwise no data will appear.
3. After version 1.2, the ngRoute module is independent.
4. An error occurs if an empty controller is not defined.
5. Directive's link parameters are in sequence: scope, element, attrs, ctrl
6.ng-repeat cannot loop duplicate objects. hack: ng-repeat="thing in things track by $id($index)"
7. Try to update the properties of the variable rather than the individual variable itself.
8. Note that ng-repeat, ng-controller, etc. will have independent scopes.
9. When jquery is loaded, use jquery, otherwise use built-in jqlite. all element references in Angular are always wrapped with jQuery or jqLite; they are never raw DOM references.
10.Uncaught Error: [$location:ihshprfx] The A tag is not removed <a href="#" ng-click="someMethod();"></a>
11.Error: listen EACCES When you are in Linux, this error will appear because of the port you are listening to. Here is mine is 33. Just change it to a large number of ports such as 8080 or 3030. There is a provision that these ports are preferably greater than 1024.
12. Select cannot be displayed without ng-model. Similarly, when encountering the best-looking document, what is missing?
Supplement: When the source of ng-options does not match the writing, all selections will occur, as follows:
var a = [{"id":1,"name":"Ryan"}....] ,ng-options="item.i as item.name for item in a" // i is different from id
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
13.ng-bind-html-unsafe has been removed, you can use the ['ngSanitize'] module or use the $sce service
From stackoverflow
You indicated that you're using Angular 1.2.0... as one of the other comments indicated, ng-bind-html-unsafe has been deprecated.
Instead, you'll want to do something like this:
Copy the code as follows: <div ng-bind-html="preview_data.preview.embed.htmlSafe"></div>
In your controller, inject the $sce service, and mark the HTML as "trusted":
Copy the code as follows: myApp.controller('myCtrl', ['$scope', '$sce', function($scope, $sce) {
// ...
$scope.preview_data.preview.embed.htmlSafe =
$sce.trustAsHtml(preview_data.preview.embed.html);
}
Note that you'll want to be using 1.2.0-rc3 or newer. (They fixed a bug in rc3 that prevented "watchers" from working properly on trusted HTML.)
To view more AngularJS syntax, you can follow: AngularJS reference manual English version, and I hope everyone will support Wulin.com more.