directive只能由小写字母组成吗?
.directive('名称', function() {
return {
restrict: 'AE',
template: '<p>Hi there</p>',
replace: true
};
});
例如,
hello ok
helloA not work
Hello not work
hello_a not work
hello-a not work
我的要一个词组命名怎么办?
迷茫2017-05-15 16:54:18
Using CamelCasenaming
Such as: hello A not work
Named: helloANotWork
Detailed rules:
Use the following method in html
html
<my-new-directive></my-new-directive>
But this is required when defining instructions
javascript
myApp.directive("myNewDirective", function(){...});