diff --git a/@salix/app/src/bootstrap.js b/@salix/app/src/bootstrap.js
index 2e2704312..b49a0112d 100644
--- a/@salix/app/src/bootstrap.js
+++ b/@salix/app/src/bootstrap.js
@@ -14,5 +14,5 @@ export const bootstrap = () => {
throw new Error("element is not defined");
}
ng.bootstrap(_element, [SALIX]);
-
+
};
diff --git a/@salix/app/src/components/left-menu/actions.html b/@salix/app/src/components/left-menu/actions.html
index 3daf70551..b794c7faa 100644
--- a/@salix/app/src/components/left-menu/actions.html
+++ b/@salix/app/src/components/left-menu/actions.html
@@ -1,5 +1,5 @@
diff --git a/@salix/app/src/components/left-menu/actions.js b/@salix/app/src/components/left-menu/actions.js
index 01b7dd0d4..a477eb0a3 100644
--- a/@salix/app/src/components/left-menu/actions.js
+++ b/@salix/app/src/components/left-menu/actions.js
@@ -4,6 +4,7 @@ import {module} from '../../module';
export const NAME = 'vnActions';
export const COMPONENT = {
template: template,
+ controllerAs: "action",
bindings: {
items: '<'
}
diff --git a/@salix/app/src/components/left-menu/left-menu.html b/@salix/app/src/components/left-menu/left-menu.html
index e90ce1506..dd68d8a7e 100644
--- a/@salix/app/src/components/left-menu/left-menu.html
+++ b/@salix/app/src/components/left-menu/left-menu.html
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/@salix/app/src/components/left-menu/left-menu.js b/@salix/app/src/components/left-menu/left-menu.js
index 3d0c527ed..9c0232413 100644
--- a/@salix/app/src/components/left-menu/left-menu.js
+++ b/@salix/app/src/components/left-menu/left-menu.js
@@ -5,6 +5,7 @@ import {module} from '../../module';
export const NAME = "vnLeftMenu";
export const COMPONENT = {
template: template,
+ controllerAs: "menu",
bindings: {
items: '<'
}
diff --git a/@salix/app/src/components/left-menu/menu-item.html b/@salix/app/src/components/left-menu/menu-item.html
index ac04772d9..3f38ba07e 100644
--- a/@salix/app/src/components/left-menu/menu-item.html
+++ b/@salix/app/src/components/left-menu/menu-item.html
@@ -1,7 +1,7 @@
-
exit_to_app
+
exit_to_app
apps
notifications
account_circle
diff --git a/@salix/app/src/components/main-menu/main-menu.js b/@salix/app/src/components/main-menu/main-menu.js
index afb5869c3..aa20ba198 100644
--- a/@salix/app/src/components/main-menu/main-menu.js
+++ b/@salix/app/src/components/main-menu/main-menu.js
@@ -5,6 +5,7 @@ import {module} from '../../module';
export const NAME = 'vnMainMenu';
export const COMPONENT = {
template: template,
+ controllerAs: "mainMenu",
controller: function ()
{
this.onLogoutClick = function ()
diff --git a/@salix/app/src/components/searchbar/searchbar.js b/@salix/app/src/components/searchbar/searchbar.js
index 0d9e5efc2..a3f36dd72 100644
--- a/@salix/app/src/components/searchbar/searchbar.js
+++ b/@salix/app/src/components/searchbar/searchbar.js
@@ -3,9 +3,6 @@ import {module} from '../../module';
export const NAME = 'vnSearchbar'
export const COMPONENT = {
- template: template,
- controller: function(){
-
- }
+ template: template
};
module.component(NAME, COMPONENT);
diff --git a/@salix/app/src/configroutes.js b/@salix/app/src/configroutes.js
index ab96122a0..2a5ae738e 100644
--- a/@salix/app/src/configroutes.js
+++ b/@salix/app/src/configroutes.js
@@ -2,34 +2,52 @@ import * as core from 'core';
import * as spliting from './spliting';
import * as deps from './spliting/deps.json';
+
function loader(module) {
- return function ($ocLazyLoad, $q) {
+
+ return function load($ocLazyLoad, $q){
return $q((resolve) => {
core.splitingRegister.execute(module).then(function (dependencies) {
var array = dependencies.map((item) => { return { name: item } });
resolve($ocLazyLoad.load(array));
});
});
- };
+
+ }
+ load.$inject = ['$ocLazyLoad', '$q'];
+}
+
+function getParams(route) {
+ var params = "",
+ temporalParams = [];
+
+ if (!route.params) {
+ return params;
+ }
+
+ Object.keys(route.params).forEach(key => {
+ temporalParams.push(key + `= "${route.params[key]}"`);
+ });
+ return temporalParams.join(" ");
}
function config($stateProvider, $urlRouterProvider) {
core.splitingRegister.registerGraph(deps);
$urlRouterProvider.otherwise('/clients');
- for (var file in routes)
+ for (var file in routes)
{
let fileRoutes = routes[file].routes;
- let module = routes[file].module;
+ let module = routes[file].module;
fileRoutes.forEach(function(route) {
$stateProvider.state(route.state, {
url: route.url,
- template: `<${route.component} full-height>${route.component}>`,
+ template: `<${route.component} full-height ${getParams(route)}>${route.component}>`,
resolve: {
- loader: loader(module)
- }
- })
+ loader: loader(module)
+ }
+ });
});
}
}
diff --git a/@salix/core/src/combo/combo.js b/@salix/core/src/combo/combo.js
index 782c3b9a7..3c29a815c 100644
--- a/@salix/core/src/combo/combo.js
+++ b/@salix/core/src/combo/combo.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
@@ -17,4 +17,4 @@ export function directive(resolve, normalizer) {
}
};
}
-module.directive(NAME, directive);
+_module.directive(NAME, directive);
diff --git a/@salix/core/src/date-picker/date-picker.js b/@salix/core/src/date-picker/date-picker.js
index c734910e8..5e5ca2e4d 100644
--- a/@salix/core/src/date-picker/date-picker.js
+++ b/@salix/core/src/date-picker/date-picker.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
@@ -16,4 +16,4 @@ export function directive(resolve, normalizer) {
}
};
}
-module.directive(NAME, directive);
+_module.directive(NAME, directive);
diff --git a/@salix/core/src/icon-button/icon-button.js b/@salix/core/src/icon-button/icon-button.js
index 095911090..180eb1b28 100644
--- a/@salix/core/src/icon-button/icon-button.js
+++ b/@salix/core/src/icon-button/icon-button.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
@@ -14,4 +14,4 @@ export function directive(resolve) {
}
};
}
-module.directive(NAME, directive);
+_module.directive(NAME, directive);
diff --git a/@salix/core/src/interpolate.js b/@salix/core/src/interpolate.js
index 0c20426d1..115c1f98e 100644
--- a/@salix/core/src/interpolate.js
+++ b/@salix/core/src/interpolate.js
@@ -36,32 +36,7 @@ $interpolateMinErr.interr = function (text, err) {
return $interpolateMinErr('interr', 'Can\'t interpolate: {0}\n{1}', text, err.toString());
};
-export class Interpolate
-{
- constructor () {
- this._startSymbol='*[';
- this._endSymbol = ']*';
- }
-
- set startSymbol (value) {
- if (value) {
- this._startSymbol = value;
- return this;
- } else {
- return this._startSymbol;
- }
- };
-
- set endSymbol (value) {
- if (value) {
- this._endSymbol = value;
- return this;
- } else {
- return this._endSymbol;
- }
- };
-
- $get($parse, $exceptionHandler, $sce) {
+function $get($parse, $exceptionHandler, $sce) {
var startSymbolLength = this._startSymbol.length,
endSymbolLength = this._endSymbol.length,
escapedStartRegexp = new RegExp(this._startSymbol.replace(/./g, escape), 'g'),
@@ -195,8 +170,37 @@ export class Interpolate
return $interpolate;
}
+
+$get.$inject = ['$parse', '$exceptionHandler', '$sce'];
+
+export class Interpolate
+{
+ constructor () {
+ this._startSymbol='*[';
+ this._endSymbol = ']*';
+ }
+
+ set startSymbol (value) {
+ if (value) {
+ this._startSymbol = value;
+ return this;
+ } else {
+ return this._startSymbol;
+ }
+ };
+
+ set endSymbol (value) {
+ if (value) {
+ this._endSymbol = value;
+ return this;
+ } else {
+ return this._endSymbol;
+ }
+ };
+
+
}
+Interpolate.prototype.$get = $get;
var interpolate = new Interpolate();
-interpolate.$get.$inject = ['$parse', '$exceptionHandler', '$sce'];
module.provider(NAME, () => interpolate);
diff --git a/@salix/core/src/password/password.js b/@salix/core/src/password/password.js
index b68191ad9..8acd37bdf 100644
--- a/@salix/core/src/password/password.js
+++ b/@salix/core/src/password/password.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as normalizerFactory from '../inputAttrsNormalizer';
import * as util from '../util';
@@ -17,4 +17,4 @@ export function directive (resolve, normalizer){
}
}
-module.directive(NAME,directive);
+_module.directive(NAME,directive);
diff --git a/@salix/core/src/resolveDefaultComponents.js b/@salix/core/src/resolveDefaultComponents.js
index 25de84dd3..fa45672c2 100644
--- a/@salix/core/src/resolveDefaultComponents.js
+++ b/@salix/core/src/resolveDefaultComponents.js
@@ -5,6 +5,26 @@ import Interpolate from './interpolate';
export const NAME = util.getProviderName('ResolveDefaultComponent');
+function $get($injector, vnInterpolate){
+ return {
+ getTemplate:function(name, attrs) {
+ this._frameworkName = 'Mdl';
+ let _name = util.getFactoryName( name + this._frameworkName);
+ let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined;
+
+ if(!defaultfactory) {
+ throw new Error("factory is not defined");
+ }
+
+ let defaultValues = defaultfactory.default;
+ let template = defaultfactory.template;
+ let scope = Object.assign({}, defaultValues || {}, attrs || {});
+ return template && vnInterpolate(template)(scope);
+ }
+ };
+}
+$get.$inject = ['$injector', 'vnInterpolate'];
+
export class ResolveDefaultComponent {
constructor() {
this._frameworkName='Mdl';
@@ -12,26 +32,8 @@ export class ResolveDefaultComponent {
set frameworkName(value) {
this._frameworkName = value;
}
- $get($injector,vnInterpolate) {
- return {
- getTemplate:function(name, attrs) {
- this._frameworkName = 'Mdl';
- let _name = util.getFactoryName( name + this._frameworkName);
- let defaultfactory = $injector.has(_name) ? $injector.get(_name) : undefined;
-
- if(!defaultfactory) {
- throw new Error("factory is not defined");
- }
-
- let defaultValues = defaultfactory.default;
- let template = defaultfactory.template;
- let scope = Object.assign({}, defaultValues || {}, attrs || {});
- return template && vnInterpolate(template)(scope);
- }
- };
- }
}
+ResolveDefaultComponent.prototype.$get = $get;
var resolve = new ResolveDefaultComponent();
-resolve.$get.$inject = ['$injector', 'vnInterpolate'];
_module.provider(NAME,() => resolve);
\ No newline at end of file
diff --git a/@salix/core/src/routesLoader.js b/@salix/core/src/routesLoader.js
index 99c001786..4ea96e99d 100644
--- a/@salix/core/src/routesLoader.js
+++ b/@salix/core/src/routesLoader.js
@@ -4,28 +4,25 @@ import * as util from './util'
export const NAME = util.getProviderName ('RoutesLoader')
-export class RoutesLoader
-{
- constructor () {}
-
- $get ($http)
- {
- let script = document.currentScript || (() => {
+function $get($http){
+ let script = document.currentScript || (() => {
let scripts = document.getElementsByTagName ('script');
return scripts[scripts.length - 1];
}) ();
let routesCdn = script.getAttribute ('routes-cdn');
-
- return $http
+ return $http
({
method: 'GET',
url: routesCdn
})
- }
}
+$get.$inject = ["$http"];
+
+export class RoutesLoader{ constructor () {} }
+
+RoutesLoader.prototype.$get = $get;
var routes = new RoutesLoader ();
-routes.$get.$inject = ['$http'];
_module.provider (NAME, () => routes)
diff --git a/@salix/core/src/snackbar/snackbar.js b/@salix/core/src/snackbar/snackbar.js
index 3209b3671..b04571659 100644
--- a/@salix/core/src/snackbar/snackbar.js
+++ b/@salix/core/src/snackbar/snackbar.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
@@ -15,4 +15,4 @@ export function directive (resolve){
}
}
-module.directive(NAME,directive);
+_module.directive(NAME,directive);
diff --git a/@salix/core/src/spinner/spinner.js b/@salix/core/src/spinner/spinner.js
index b7bc987b2..03bbd9f5f 100644
--- a/@salix/core/src/spinner/spinner.js
+++ b/@salix/core/src/spinner/spinner.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
@@ -15,4 +15,4 @@ export function directive (resolve){
}
}
-module.directive(NAME,directive);
+_module.directive(NAME,directive);
diff --git a/@salix/core/src/submit/submit.js b/@salix/core/src/submit/submit.js
index 4f548ced9..a13771944 100644
--- a/@salix/core/src/submit/submit.js
+++ b/@salix/core/src/submit/submit.js
@@ -1,4 +1,4 @@
-import {module} from '../module';
+import {module as _module} from '../module';
import * as resolveFactory from '../resolveDefaultComponents';
import * as util from '../util';
@@ -15,4 +15,4 @@ export function directive (resolve){
}
}
-module.directive(NAME,directive);
+_module.directive(NAME,directive);
diff --git a/@salix/core/src/title/title.js b/@salix/core/src/title/title.js
index 7cde9b468..8de6aad4d 100644
--- a/@salix/core/src/title/title.js
+++ b/@salix/core/src/title/title.js
@@ -1,9 +1,9 @@
import template from './title.html';
-import {module} from '../module';
+import {module as _module} from '../module';
export const NAME = "vnTitle";
export const COMPONENT = {
template: template,
transclude: true
};
-module.component(NAME, COMPONENT);
+_module.component(NAME, COMPONENT);
diff --git a/@salix/crud/src/client/addresses/index.html b/@salix/crud/src/client/addresses/index.html
index d8bb95e7a..e51684d82 100644
--- a/@salix/crud/src/client/addresses/index.html
+++ b/@salix/crud/src/client/addresses/index.html
@@ -5,7 +5,7 @@
Consignee
Enabled
-
+
diff --git a/@salix/crud/src/client/addresses/index.js b/@salix/crud/src/client/addresses/index.js
index 35725150e..f00d9ea39 100644
--- a/@salix/crud/src/client/addresses/index.js
+++ b/@salix/crud/src/client/addresses/index.js
@@ -4,28 +4,26 @@ import {module} from '../../module';
export const NAME = 'vnClientAddresses';
export const COMPONENT = {
template: template,
- controller: function ($http)
+ controllerAs: 'address',
+ controller: function($http)
{
-/* $http.get('/client/api/Addresses', this.model).then (
- (json) => { this.addresses = json.data; },
- (json) => console.error (json.data.error.message)
- );
-*/
- this.addresses = [];
- for (var i = 1; i <= 4; i++)
- this.addresses.push ({
- "consignee": "Consignee",
- "street": "Street",
- "city": "City",
- "postcode": "46600",
- "province": "Province",
- "country": "Country",
- "phone": "+XX XXX XX XX XX",
- "mobile": "+XX 6XX XX XX XX",
- "enabled": true
- });
- },
+ this.addresses = [];
+
+ for (var i = 1; i <= 4; i++)
+ this.addresses.push({
+ consignee: "Consignee",
+ street: "Street",
+ city: "City",
+ postcode: "46600",
+ province: "Province",
+ country: "Country",
+ phone: "+XX XXX XX XX XX",
+ mobile: "+XX 6XX XX XX XX",
+ enabled: true
+ });
+ }
};
+
COMPONENT.controller.$inject = ['$http'];
module.component(NAME, COMPONENT);
diff --git a/@salix/crud/src/client/basic-data/index.html b/@salix/crud/src/client/basic-data/index.html
index 9cd76e86a..1d9faafcf 100644
--- a/@salix/crud/src/client/basic-data/index.html
+++ b/@salix/crud/src/client/basic-data/index.html
@@ -1,20 +1,20 @@
-