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

View File

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