Skip to content

Instantly share code, notes, and snippets.

View vogloblinsky's full-sized avatar

Vincent Ogloblinsky vogloblinsky

View GitHub Profile
/* global module */
const AotPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
const CompressionPlugin = require("compression-webpack-plugin");
const path = require('path');
module.exports = {
entry: './src/main.ts',
resolve: {
mainFields: ['es2015', 'browser', 'module', 'main']
},
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Angular Elements Demo</title>
</head>
<body>
<hello-world name="Anna"></hello-world>
registerAsCustomElements([HelloComponent], () =>
platformBrowserDynamic().bootstrapModule(HelloModule)
);
@NgModule({
imports: [BrowserModule],
declarations: [HelloComponent],
entryComponents: [HelloComponent]
})
export class HelloModule {
ngDoBootstrap() {}
}
@Component({
selector: 'hello-world',
template: `<h1>
Hello world ! My name is {{name}} !
</h1>
<button (click)="onClick()">Hi !</button>`,
styles: [`
button {
color: #3498db;
}
@vogloblinsky
vogloblinsky / gist:1429f035cf4a7306be64
Last active February 17, 2016 15:25
ObserverService
'use strict';
/**
* @ngdoc service
* @name ObserverModule:ObserverService
* @description
* # ObserverService
* Manages all events inside the application
*
*/
@vogloblinsky
vogloblinsky / gist:e4cf61817e1772cb7b21
Created December 15, 2015 23:19
AngularJS PubSub Engine
/*global _:false */
'use strict';
angular.module('PubSubEngineModule')
.factory('PubSubEngine', ['$q', '$rootScope',
function($q, $rootScope) {
var PubSubEngine = {};