Transform account state to component.

This commit is contained in:
Alexis Lahouze 2017-07-16 14:23:23 +02:00
parent 83d7e61875
commit 330ed6b926
2 changed files with 8 additions and 4 deletions

View File

@ -27,6 +27,8 @@ var ngResource = require('angular-resource'),
ngUiNotification = require('angular-ui-notification'),
ngStrap = require('angular-strap');
var accountsTmpl = require('./accounts.html');
import { AccountBalancesFactory } from './accountBalances.factory';
import { AccountService } from './account.service';
import { AccountComponent } from './account.component';
@ -42,6 +44,10 @@ export default angular.module('accountant.accounts', [
.factory('AccountService', downgradeInjectable(AccountService))
.controller('AccountController', AccountComponent)
.component('accountList', {
controller: AccountComponent,
controllerAs: 'accountsCtrl',
templateUrl: accountsTmpl
})
.name;

View File

@ -29,9 +29,7 @@ export default function AppConfig($uiRouterProvider) {
$stateRegistry.register({
name: 'accounts',
url: '/accounts',
templateUrl: accountsTmpl,
controller: 'AccountController',
controllerAs: 'accountsCtrl'
component: 'accountList',
});
const $urlService = $uiRouterProvider.urlService;