From 1e941099102073c278a0c3bab0b387fc372288c6 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Thu, 13 Jul 2017 21:37:47 +0200 Subject: [PATCH] Typescript conversion. --- src/accounts/account.config.ts | 2 +- src/accounts/account.factory.ts | 2 +- src/accounts/accountBalances.factory.ts | 2 +- src/accounts/index.ts | 10 ++++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/accounts/account.config.ts b/src/accounts/account.config.ts index e3d412b..1efe02e 100644 --- a/src/accounts/account.config.ts +++ b/src/accounts/account.config.ts @@ -1,4 +1,4 @@ -module.exports = function($resourceProvider) { +export function AccountConfig($resourceProvider) { // Keep trailing slashes to avoid redirect by flask. $resourceProvider.defaults.stripTrailingSlashes = false; }; diff --git a/src/accounts/account.factory.ts b/src/accounts/account.factory.ts index 1f24176..d53182e 100644 --- a/src/accounts/account.factory.ts +++ b/src/accounts/account.factory.ts @@ -1,4 +1,4 @@ -module.exports = function($resource) { +export function AccountFactory($resource) { return $resource( '/api/account/:id', { id: '@id' diff --git a/src/accounts/accountBalances.factory.ts b/src/accounts/accountBalances.factory.ts index df19920..35306b0 100644 --- a/src/accounts/accountBalances.factory.ts +++ b/src/accounts/accountBalances.factory.ts @@ -1,4 +1,4 @@ -module.exports = function($resource) { +export function AccountBalancesFactory($resource) { return $resource( '/api/account/:id/balances', { id: '@id' diff --git a/src/accounts/index.ts b/src/accounts/index.ts index 57db7ef..179fcc5 100644 --- a/src/accounts/index.ts +++ b/src/accounts/index.ts @@ -17,17 +17,19 @@ */ /* jshint node: true */ 'use strict'; - var angular = require('angular'); +//declare var angular: angular.IAngularStatic; +import { downgradeInjectable } from '@angular/upgrade/static'; + var ngResource = require('angular-resource'), ngMessages = require('angular-messages'), ngUiNotification = require('angular-ui-notification'), ngStrap = require('angular-strap'); -var AccountFactory = require('./account.factory'); -var AccountBalancesFactory = require('./accountBalances.factory'); -var AccountConfig = require('./account.config'); +import { AccountFactory } from './account.factory'; +import { AccountBalancesFactory } from './accountBalances.factory'; +import { AccountConfig } from './account.config'; import { AccountController } from './account.controller'; export default angular.module('accountant.accounts', [