Commit f9dfb4a0 authored by Giovannoni Laurent's avatar Giovannoni Laurent

FEAT init angular2

parent 9ba03311
......@@ -226,9 +226,27 @@ if(empty($_SESSION['current_basket'])){
?>
<body ng-app="AppModule" ng-controller="mainCtrl" style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php
<!-- Polyfill(s) for older browsers -->
<!-- <script src="/node_modules/core-js/client/shim.js"></script>
<script src="/node_modules/zone.js/dist/zone.js"></script>
<script src="/node_modules/systemjs/dist/system.src.js"></script>
<script src="js/angular/systemjs.config.js"></script> -->
<!-- <script>
System.import('js/angular/main.js').catch(function(err){ console.error(err); });
</script> -->
<!--body ng-app="AppModule" ng-controller="mainCtrl" style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php
echo $_SESSION['config']['businessappurl'];
?>index.php?display=true&page=logout&logout=true');" id="maarch_body"-->
<body style="background: url('static.php?filename=loading_big.gif') no-repeat fixed center;" onload="$('maarch_body').style.background='f2f2f2';$('maarch_body').style.backgroundImage='';$('maarch_body').style.backgroundUrl='';$('maarch_content').style.display='block';session_expirate(<?php echo $time;?>, '<?php
echo $_SESSION['config']['businessappurl'];
?>index.php?display=true&page=logout&logout=true');" id="maarch_body">
<my-app>Loading AppComponent content here ...</my-app>
<div id ="maarch_content" style="display:none;">
<?php
......
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var AppComponent = (function () {
function AppComponent() {
this.name = 'Angular';
}
AppComponent = __decorate([
core_1.Component({
selector: 'my-app',
template: "<h1>Hello {{name}}</h1>",
}),
__metadata('design:paramtypes', [])
], AppComponent);
return AppComponent;
}());
exports.AppComponent = AppComponent;
//# sourceMappingURL=app.component.js.map
\ No newline at end of file
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<h1>Hello {{name}}</h1>`,
})
export class AppComponent { name = 'Angular'; }
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var core_1 = require('@angular/core');
var platform_browser_1 = require('@angular/platform-browser');
var app_component_1 = require('./app.component');
var AppModule = (function () {
function AppModule() {
}
AppModule = __decorate([
core_1.NgModule({
imports: [platform_browser_1.BrowserModule],
declarations: [app_component_1.AppComponent],
bootstrap: [app_component_1.AppComponent]
}),
__metadata('design:paramtypes', [])
], AppModule);
return AppModule;
}());
exports.AppModule = AppModule;
//# sourceMappingURL=app.module.js.map
\ No newline at end of file
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
"use strict";
var platform_browser_dynamic_1 = require('@angular/platform-browser-dynamic');
var app_module_1 = require('./app/app.module');
platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule);
//# sourceMappingURL=main.js.map
\ No newline at end of file
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': '/node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'js/angular/app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
}
}
});
})(this);
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
......@@ -44,9 +44,11 @@ class MergedJsAbstract {
readfile('apps/maarch_entreprise/js/prototype.js');
readfile('apps/maarch_entreprise/js/scriptaculous.js');
readfile('apps/maarch_entreprise/js/jquery.min.js');
readfile('apps/maarch_entreprise/js/angular.min.js');
readfile('apps/maarch_entreprise/js/angular-route.js');
readfile('apps/maarch_entreprise/js/ng-table.min.js');
// readfile('apps/maarch_entreprise/js/angular.min.js');
// readfile('apps/maarch_entreprise/js/angular-route.js');
// readfile('apps/maarch_entreprise/js/ng-table.min.js');
readfile('apps/maarch_entreprise/js/indexing.js');
readfile('apps/maarch_entreprise/js/scrollbox.js');
readfile('apps/maarch_entreprise/js/effects.js');
......@@ -58,12 +60,19 @@ class MergedJsAbstract {
readfile('apps/maarch_entreprise/js/Chart.js');
readfile('apps/maarch_entreprise/js/chosen.proto.min.js');
readfile('apps/maarch_entreprise/js/event.simulate.js');
readfile('apps/maarch_entreprise/js/RSVP.js');
readfile('apps/maarch_entreprise/js/render.js');
readfile('apps/maarch_entreprise/js/jio.js');
//for office.js
//readfile('apps/maarch_entreprise/js/RSVP.js');
//readfile('apps/maarch_entreprise/js/render.js');
//readfile('apps/maarch_entreprise/js/jio.js');
// readfile('apps/maarch_entreprise/js/app.module.js');
// readfile('apps/maarch_entreprise/js/aController.js');
readfile('apps/maarch_entreprise/js/app.module.js');
readfile('apps/maarch_entreprise/js/aController.js');
readfile('node_modules/core-js/client/shim.js');
readfile('node_modules/zone.js/dist/zone.js');
readfile('node_modules/systemjs/dist/system.src.js');
readfile('apps/maarch_entreprise/js/angular/systemjs.config.js');
echo "\n";
}
......@@ -77,11 +86,11 @@ class MergedJsAbstract {
{
include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/functions.js');
}
if(file_exists($_SESSION['config']['corepath'].'custom/'.$_SESSION['custom_override_id'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js')
|| file_exists($_SESSION['config']['corepath'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js'))
{
include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js');
}
// if(file_exists($_SESSION['config']['corepath'].'custom/'.$_SESSION['custom_override_id'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js')
// || file_exists($_SESSION['config']['corepath'].'/modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js'))
// {
// include('modules/'.$_SESSION['modules_loaded'][$value]['name'].'/js/aController.js');
// }
}
}
}
......
......@@ -1580,6 +1580,9 @@ class core_tools extends functions
var app_path = '<?php echo $_SESSION['config']['businessappurl'];?>static.php?filename=';
</script>-->
<script type="text/javascript" src="<?php echo $_SESSION['config']['businessappurl'];?>merged_js.php"></script>
<script>
System.import('js/angular/main.js').catch(function(err){ console.error(err); });
</script>
<?php
}
......
......@@ -313,7 +313,8 @@ if (count($_SESSION['user']['baskets']) > 0) {
}
?>
</h1>
<div id="inner_content" class="clearfix" ng-controller="basketCtrl">
<!--div id="inner_content" class="clearfix" ng-controller="basketCtrl"-->
<div id="inner_content" class="clearfix">
<?php
......
{
"name": "MaarchCourrier",
"version": "1.0.0",
"description": "MaarchCourrier",
"scripts": {
"build": "tsc -p apps/maarch_entreprise/js/angular/",
"build:watch": "tsc -p apps/maarch_entreprise/js/angular/ -w"
},
"keywords": [],
"author": "Maarch",
"license": "GPLV3",
"dependencies": {
"@angular/common": "~2.4.0",
"@angular/compiler": "~2.4.0",
"@angular/core": "~2.4.0",
"@angular/forms": "~2.4.0",
"@angular/http": "~2.4.0",
"@angular/platform-browser": "~2.4.0",
"@angular/platform-browser-dynamic": "~2.4.0",
"@angular/router": "~3.4.0",
"angular-in-memory-web-api": "~0.2.4",
"systemjs": "0.19.40",
"core-js": "^2.4.1",
"rxjs": "5.0.1",
"zone.js": "^0.7.4"
},
"devDependencies": {
"typescript": "~2.0.10"
},
"repository": {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment