refactor: move angular source to /packages rather than modules/@angular
This commit is contained in:
20
packages/examples/_common/bootstrap.ts
Normal file
20
packages/examples/_common/bootstrap.ts
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
(function(global: any) {
|
||||
writeScriptTag('/vendor/zone.js');
|
||||
writeScriptTag('/vendor/system.js');
|
||||
writeScriptTag('/vendor/Reflect.js');
|
||||
writeScriptTag('/_common/system-config.js');
|
||||
if (location.pathname.indexOf('/upgrade/') != -1) {
|
||||
writeScriptTag('/vendor/angular.js');
|
||||
}
|
||||
|
||||
function writeScriptTag(scriptUrl: string, onload: string = '') {
|
||||
document.write('<script src="' + scriptUrl + '" onload="' + onload + '"></script>');
|
||||
}
|
||||
}(window));
|
26
packages/examples/_common/e2e_util.ts
Normal file
26
packages/examples/_common/e2e_util.ts
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
/* tslint:disable:no-console */
|
||||
import * as webdriver from 'selenium-webdriver';
|
||||
declare var browser: any;
|
||||
declare var expect: any;
|
||||
|
||||
// TODO (juliemr): remove this method once this becomes a protractor plugin
|
||||
export function verifyNoBrowserErrors() {
|
||||
browser.manage().logs().get('browser').then(function(browserLog: any[]) {
|
||||
const errors: any[] = [];
|
||||
browserLog.filter(logEntry => {
|
||||
const msg = logEntry.message;
|
||||
console.log('>> ' + msg);
|
||||
if (logEntry.level.value >= webdriver.logging.Level.INFO.value) {
|
||||
errors.push(msg);
|
||||
}
|
||||
});
|
||||
expect(errors).toEqual([]);
|
||||
});
|
||||
}
|
16
packages/examples/_common/index.html
Normal file
16
packages/examples/_common/index.html
Normal file
@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon" />
|
||||
<script type="text/javascript" src="bootstrap.js"></script>
|
||||
<script type="text/javascript">
|
||||
System.import('main-dynamic').catch(console.error.bind(console));
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<example-app>
|
||||
loading...
|
||||
</example-app>
|
||||
</body>
|
||||
</html>
|
13
packages/examples/_common/main-dynamic.ts
Normal file
13
packages/examples/_common/main-dynamic.ts
Normal file
@ -0,0 +1,13 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
|
||||
import * as mod from './module';
|
||||
|
||||
if (mod.AppModule) {
|
||||
platformBrowserDynamic().bootstrapModule(mod.AppModule);
|
||||
}
|
19
packages/examples/_common/module.d.ts
vendored
Normal file
19
packages/examples/_common/module.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
DO NOT DELETE THIS FILE
|
||||
=======================
|
||||
|
||||
The purpose of this file is to allow `main-dynamic.ts` to be tsc-compiled
|
||||
BEFORE it is copied over to each of the associated example directories
|
||||
within `dist/examples`.
|
||||
|
||||
*/
|
||||
export class AppModule {};
|
32
packages/examples/_common/system-config.ts
Normal file
32
packages/examples/_common/system-config.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
System.config({
|
||||
defaultJSExtensions: true,
|
||||
map: {
|
||||
'@angular/common': '/vendor/@angular/common/bundles/common.umd.js',
|
||||
'@angular/compiler': '/vendor/@angular/compiler/bundles/compiler.umd.js',
|
||||
'@angular/animations': '/vendor/@angular/animations/bundles/animations.umd.js',
|
||||
'@angular/platform-browser/animations':
|
||||
'/vendor/@angular/platform-browser/bundles/platform-browser-animations.umd.js',
|
||||
'@angular/core': '/vendor/@angular/core/bundles/core.umd.js',
|
||||
'@angular/forms': '/vendor/@angular/forms/bundles/forms.umd.js',
|
||||
'@angular/http': '/vendor/@angular/forms/bundles/http.umd.js',
|
||||
'@angular/platform-browser':
|
||||
'/vendor/@angular/platform-browser/bundles/platform-browser.umd.js',
|
||||
'@angular/platform-browser-dynamic':
|
||||
'/vendor/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
|
||||
'@angular/router': '/vendor/@angular/router/bundles/router.umd.js',
|
||||
'@angular/upgrade': '/vendor/@angular/upgrade/bundles/upgrade.umd.js',
|
||||
'@angular/upgrade/static': '/vendor/@angular/upgrade/bundles/upgrade-static.umd.js',
|
||||
'rxjs': '/vendor/rxjs',
|
||||
},
|
||||
packages: {
|
||||
// rxjs: {format: 'cjs', exports: 'Rx' }
|
||||
rxjs: {defaultExtension: 'js'}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user