These are chat archives for AngularClass/NG6-starter

7th
Oct 2016
Josoroma
@josoroma
Oct 07 2016 18:22
Hi again! I have a roadblock trying to separate the config file into a separate file:
angular.module('assessments', [
  uiRouter,
  Common,
  Components
])
.config(($locationProvider) => {
  "ngInject";
  // @see: https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions
  // #how-to-configure-your-server-to-work-with-html5mode
  $locationProvider.html5Mode(true).hashPrefix('!');
})
Josoroma
@josoroma
Oct 07 2016 21:26
I got it:
import angular from 'angular';
import uiRouter from 'angular-ui-router';

import HomeComponent from './home.component';
import HomeConfig from './home.config';

let homeModule = angular.module('home', [
  uiRouter
])

.config(HomeConfig)

.component('home', HomeComponent)

.name;

export default homeModule;
let homeConfig = function($urlRouterProvider, $stateProvider) {
  "ngInject";

  $urlRouterProvider.otherwise('/');

  $stateProvider
    .state('home', {
      url: '/',
      component: 'home'
    });
};

export default homeConfig;