0
github의 Hygieia 프로젝트에 위젯을 추가하려고합니다. 내가 페이지에 위젯을 추가하면 표시하지 않고이 오류 얻을 : 나는 이미 유사한 모듈에 존재하는 코드 뒤에 추가 한 모든 코드를 모델로 한각도 js에서 정의되지 않은 뷰를 찾을 수 없습니다. 모듈이 정의되었습니다.
TypeError: Cannot read property 'view' of undefined
at link (http://localhost:3000/app/dashboard/directives/widget.js:49:64)
at http://localhost:3000/bower_components/bower.js:9682:44
at invokeLinkFn (http://localhost:3000/bower_components/bower.js:9688:9)
at nodeLinkFn (http://localhost:3000/bower_components/bower.js:9198:11)
at delayedNodeLinkFn (http://localhost:3000/bower_components/bower.js:9446:11)
at compositeLinkFn (http://localhost:3000/bower_components/bower.js:8547:13)
at compositeLinkFn (http://localhost:3000/bower_components/bower.js:8550:13)
at compositeLinkFn (http://localhost:3000/bower_components/bower.js:8550:13)
at compositeLinkFn (http://localhost:3000/bower_components/bower.js:8550:13)
at compositeLinkFn (http://localhost:3000/bower_components/bower.js:8550:13) <widget name="aws-status" class="ng-isolate-scope">
,하지만 몇 가지 이유 위젯은 페이지에 표시되지 않습니다. 여기에 내가 모듈을 선언하고있어 경우, 당신은 내가 잘못하고있는 무슨 결정하기 위해 다른 코드 섹션을 참조해야하는 경우 알려 주시기입니다 :
내가 말 2 괄호를 실종됐다 발견했습니다(function() {
'use strict';
var widget_state,
config = {
view: {
defaults: {
title: 'AWS Status' // widget title
},
controller: 'awsStatusViewController',
controllerAs: 'ctrl',
templateUrl: 'components/widgets/awsstatus/view.html'
},
config: {
controller: 'awsStatusConfigController',
controllerAs: 'ctrl',
templateUrl: 'components/widgets/awsstatus/config.html'
},
getState: getState
};
angular
.module(HygieiaConfig.module)
.config(register);
register.$inject = ['widgetManagerProvider', 'WidgetState'];
function register(widgetManagerProvider, WidgetState) {
widget_state = WidgetState;
widgetManagerProvider.register('aws-status', config);
}
function getState(widgetConfig) {
return HygieiaConfig.local ?
widget_state.READY :
(widgetConfig.id ? widget_state.READY : widget_state.CONFIGURE);
}
});