0
나는 내 편집기에 ngcomponent
를 입력 할 때, 다음과 같은 구조로 확장, Atom
에 대한 angular-js-styleguide-snippets
을 사용하고 있습니다 :각도 구성 요소의 스타일 가이드
(function() {
'use strict';
angular
.module('arroyo')
.component('intro', component);
/* @ngInject */
function component() {
var settings = {
template: '<h1>test</h1>',
controller: Controller,
};
return settings;
}
Controller.$inject = [];
/* @ngInject */
function Controller() {
}
})();
을하지만, 작동하지 않는 것 위의 코드를 사용하여. 콘솔 오류는 없지만 구성 요소 자체 (<intro></intro>
)는 아무 것도 렌더링하지 않습니다. 주변을 둘러보고 난 후 아래 코드를 사용하면 예상대로 작동한다는 것을 알게되었습니다.
(function() {
'use strict';
angular
.module('arroyo')
.component('intro', {
template: '<h1>test</h1>'
});
})();
첫 번째 코드 단편의 잘못된 점은 무엇입니까?