angular.js - directive naming rules?
phpcn_u1582
phpcn_u1582 2017-05-15 16:52:18
0
1
794

Directive can only be composed of lowercase letters?

.directive('名称', function() {
    return {
        restrict: 'AE',
        template: '<p>Hi there</p>',
        replace: true
    };
});

For example,
hello ok
helloA not work
Hello not work
hello_a not work
hello-a not work

What should I do if I want to name it with a phrase?

phpcn_u1582
phpcn_u1582

reply all(1)
迷茫

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

javascriptmyApp.directive("myNewDirective", function(){...});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template