Answer the question
In order to leave comments, you need to log in
How to export angular modules to es6?
I am writing an application in angulan 1.5, I want to use es6. How to properly export your modules for connection in the central. So far I'm doing this:
let myModule = angular.module('myModule ', [])
.controller('myController', myController);
export default myModule ;
import myModule from './my-module/my-module.module';
angular.module('app', ['myModule'])
Answer the question
In order to leave comments, you need to log in
Тодд Мотто написал отличное руководство по использованию Angular 1.x и ES2015.
Пример:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import AppComponent from './app.component';
import ComponentsModule from './components/components.module';
import CommonModule from './common/common.module';
const AppModule = angular
.module('app', [
ComponentsModule,
CommonModule,
uiRouter
])
.component('app', AppComponent)
.name;
export default AppModule;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question