Skip to content

Instantly share code, notes, and snippets.

View cyrilletuzi's full-sized avatar

Cyrille Tuzi cyrilletuzi

View GitHub Profile
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@NgModule({
imports: [CommonModule]
})
export class AmazingModule {}
import { NgModule } from '@angular/core';
import { PrivateComponent } from './private.component';
import { PublicComponent } from './public.component';
@NgModule({
declarations: [
PrivateComponent,
PublicComponent
],
{
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"stripInternal": true,
"experimentalDecorators": true,
"strictNullChecks": true,
"noImplicitAny": true,
"module": "es2015",
"moduleResolution": "node",
{
"scripts": {
"transpile": "ngc",
"package": "rollup -c",
"minify": "uglifyjs dist/bundles/amazing.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/amazing.umd.min.js",
"build": "npm run transpile && npm run package && npm run minify"
}
}
export default {
entry: 'dist/index.js',
dest: 'dist/bundles/amazing.umd.js',
sourceMap: false,
format: 'umd',
moduleName: 'ng.amazing',
globals: {
'@angular/core': 'ng.core',
'rxjs/Observable': 'Rx',
'rxjs/ReplaySubject': 'Rx',
export { AmazingModule } from './amazing.module';
export { AmazingComponent } from './amazing.component';
export { AmazingService } from './amazing.service';
System.config({
map: {
'@angular/core': 'node_modules/@angular/core/bundles/core.umd.js',
'angular-async-local-storage': 'node_modules/angular-async-local-storage/bundles/async-local-storage.umd.js'
}
});
<!doctype html>
<meta charset="utf-8">
<!-- Good structure -->
<div id="wrapper-global">
<div id="header">
<div id="header-logo">Logo (on the left)</div>
<div id="header-nav">Menu (on the right)</div>
</div>
<div id="wrapper-main">
<div id="content">
<div class="story">Article 1</div>
<div class="story">Article 2</div>