I can't get the header component to register as a module.
I'm stuck, trying to add a new module. I'm using the gulp-angular-scaffold. When running Unit tests (Jasmine), the 'header' module is not defined.
It seems like I'm missing a module declaration, but I'm not sure of where or why?
Thanks in advance
folder structure snapshot:
├── app/
│ │ ├── components/
│ │ │ └── header/
│ │ │ │ ├── header.controller.js
| | | | ├── header.directive.js
| | | | ├── header.spec.js
| | | | ├── header.js
| | | | ├── header.less
│ │ │ │ └── header.html
│ │ ├── main/
│ │ │ ├── main.controller.js
│ │ │ ├── main.controller.spec.js
│ │ │ └── main.html
│ │ └── index.js
index.js:(loads the base/only successful module)
angular.module('styleguide', ['ngSanitize', 'ui.router', 'ui.bootstrap'])
.controller('MainCtrl', MainCtrl)
header.js:
'use strict';
import HeaderCtrl from 'header.controller.js';
import HeaderNav from 'header.directive.js';
angular.module('header', ['styleguide'])
.controller('HeaderCtrl', HeaderCtrl)
.directive('HeaderDir', HeaderNav)
.config();
header.controller.js
'use strict';
class HeaderCtrl {
constructor ($scope) {
$scope.Project = 'header.controller';
}
}
HeaderCtrl.$inject = ['$scope'];
export default HeaderCtrl;
header.directive.js
'use strict';
class HeaderNav {
constructor(){
return {
templateUrl: '../components/header/header.html'
};
}
}
export default HeaderNav;
header.controller.jsandheader.directive.jslook like? Are there any syntax errors in those files?