This repository has been archived by the owner on May 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(build): add webpack with ES2015 modules
Massive changes to bundle vendor and app libs using webpack, using ES2015 modules (import). The resources, js and css, are loaded from the folder "build"; html files, the templates, are not bundled. This step helps the migration towards Angular. To contribute the developer needs to watch the changes with the command "npm run watch", creating new bundle files. Known issues: - crosshair disabled in candles chart due to d3 event and techan issues in ES2015 module compatibility
- Loading branch information
1 parent
28861e4
commit 19e07a5
Showing
114 changed files
with
2,181 additions
and
2,184 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
"use strict"; | ||
import { AppController } from "./app.controller"; | ||
|
||
{ | ||
const app = { | ||
templateUrl: "app/common/app.html", | ||
controller: "AppController" | ||
}; | ||
|
||
angular | ||
.module("common") | ||
.component("app", app); | ||
} | ||
export const appComponent = { | ||
templateUrl: "app/common/app.html", | ||
controller: AppController | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,38 @@ | ||
"use strict"; | ||
export function appConfig($httpProvider, $locationProvider) { | ||
const interceptors = $httpProvider.interceptors; | ||
|
||
{ | ||
angular | ||
.module("common") | ||
.config(config); | ||
interceptors.push(["$q", "$rootScope", ($q, $rootScope) => { | ||
let nLoadings = 0; | ||
|
||
config.$inject = ["$httpProvider", "$locationProvider"]; | ||
function config($httpProvider, $locationProvider) { | ||
const interceptors = $httpProvider.interceptors; | ||
return { | ||
request(request) { | ||
nLoadings += 1; | ||
|
||
interceptors.push(["$q", "$rootScope", ($q, $rootScope) => { | ||
let nLoadings = 0; | ||
$rootScope.isLoadingView = true; | ||
|
||
return { | ||
request(request) { | ||
nLoadings += 1; | ||
return request; | ||
}, | ||
|
||
$rootScope.isLoadingView = true; | ||
|
||
return request; | ||
}, | ||
|
||
response(response) { | ||
nLoadings -= 1; | ||
if (nLoadings === 0) { | ||
$rootScope.isLoadingView = false; | ||
} | ||
|
||
return response; | ||
}, | ||
response(response) { | ||
nLoadings -= 1; | ||
if (nLoadings === 0) { | ||
$rootScope.isLoadingView = false; | ||
} | ||
|
||
responseError(response) { | ||
nLoadings -= 1; | ||
if (!nLoadings) { | ||
$rootScope.isLoadingView = false; | ||
} | ||
return response; | ||
}, | ||
|
||
return $q.reject(response); | ||
responseError(response) { | ||
nLoadings -= 1; | ||
if (!nLoadings) { | ||
$rootScope.isLoadingView = false; | ||
} | ||
}; | ||
}]); | ||
|
||
$locationProvider.html5Mode(true); | ||
} | ||
return $q.reject(response); | ||
} | ||
}; | ||
}]); | ||
|
||
$locationProvider.html5Mode(true); | ||
} | ||
appConfig.$inject = ["$httpProvider", "$locationProvider"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,14 @@ | ||
"use strict"; | ||
|
||
{ | ||
angular | ||
.module("common") | ||
.controller("AppController", AppController); | ||
|
||
AppController.$inject = []; | ||
function AppController() { | ||
const vm = this; | ||
|
||
vm.tabSelectedIndex = 0; | ||
export class AppController { | ||
$onInit() { | ||
this.tabSelectedIndex = 0; | ||
} | ||
|
||
vm.next = () => { | ||
vm.tabSelectedIndex = Math.min(vm.tabSelectedIndex + 1, 6); | ||
}; | ||
vm.previous = () => { | ||
vm.tabSelectedIndex = Math.max(vm.tabSelectedIndex - 1, 0); | ||
}; | ||
next() { | ||
this.tabSelectedIndex = Math.min(this.tabSelectedIndex + 1, 6); | ||
} | ||
|
||
previous() { | ||
this.tabSelectedIndex = Math.max(this.tabSelectedIndex - 1, 0); | ||
} | ||
} | ||
AppController.$inject = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
"use strict"; | ||
import "./app.css"; | ||
|
||
angular | ||
.module("common", [ | ||
"ngMaterial" | ||
]); | ||
import angular from "angular"; | ||
import material from "angular-material"; | ||
|
||
import { appComponent } from "./app.component"; | ||
import { appConfig } from "./app.config"; | ||
|
||
export const app = angular | ||
.module("common.app", [ | ||
material | ||
]) | ||
.component("app", appComponent) | ||
.config(appConfig) | ||
.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import angular from "angular"; | ||
|
||
import { app } from "./app.module"; | ||
|
||
export const common = angular | ||
.module("common", [ | ||
app | ||
]) | ||
.name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { AccountController } from "./account.controller"; | ||
|
||
export const accountComponent = { | ||
templateUrl: "app/components/account/account.html", | ||
controller: AccountController | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export class AccountController { | ||
constructor(AccountService) { | ||
this.AccountService = AccountService; | ||
} | ||
|
||
$onInit() { | ||
this.account = this.AccountService.getAccount(); | ||
} | ||
} | ||
AccountController.$inject = ["AccountsService"]; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
"use strict"; | ||
import angular from "angular"; | ||
|
||
angular | ||
.module("components.account", []); | ||
import { accountComponent } from "./account.component"; | ||
import { AccountsService } from "./accounts.service"; | ||
|
||
export const account = angular | ||
.module("components.account", []) | ||
.component("account", accountComponent) | ||
.service("AccountsService", AccountsService) | ||
.name; |
Oops, something went wrong.