Skip to content

Instantly share code, notes, and snippets.

@Swiip
Last active October 23, 2016 08:05
Show Gist options
  • Save Swiip/71a307d97a8aa2617c88b25de5b69955 to your computer and use it in GitHub Desktop.
Save Swiip/71a307d97a8aa2617c88b25de5b69955 to your computer and use it in GitHub Desktop.
Meet Fountain
<div class="main-container">
<fountain-header></fountain-header>
<main class="main">
<fountain-title></fountain-title>
<fountain-techs></fountain-techs>
</main>
<fountain-footer></fountain-footer>
</div>
angular.module('techs').component({
template: require('./template.html'),
controller: MainController
});
class MainController {
constructor() {
console.log('Component Main Controller');
}
}
import {Component} from '@angular/core';
@Component({
selector: 'fountain-app',
template: `
<div class="main-container">
<fountain-header></fountain-header>
<main class="main">
<fountain-title></fountain-title>
<fountain-techs></fountain-techs>
</main>
<fountain-footer></fountain-footer>
</div>
`
})
export class MainComponent {
constructor() {
console.log('Component Main Controller');
}
}
{
"name": "fountain-inject",
"version": "0.0.1",
"dependencies": {
"angular": "^1.5.0",
"angular-ui-router": "1.0.0-beta.1"
},
"devDependencies": {
"angular-mocks": "^1.5.0"
}
}
ng.core.Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
}).Class({
constructor: function() {}
});
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
})
export class AppComponent { }
{
"dependencies": {
"react": "^15.0.1",
"react-dom": "^15.0.1",
"react-router": "^2.4.0",
"axios": "^0.9.1"
},
"devDependencies": {
"react-addons-test-utils": "^15.0.1",
"del": "^2.0.2",
"gulp": "gulpjs/gulp#4ed9a4a3275559c73a396eff7e1fde3824951ebb",
"gulp-hub": "frankwallis/gulp-hub#d461b9c700df9010d0a8694e4af1fb96d9f38bf4",
"gulp-filter": "^4.0.0",
/* ... */ /* ... */ /* ... */
"gulp-util": "^3.0.7",
"gulp-sass": "^2.1.1",
"browser-sync": "^2.9.11",
"browser-sync-spa": "^1.0.3",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-junit-reporter": "^1.1.0",
"jasmine": "^2.4.1",
"es6-shim": "^0.35.0",
"karma-phantomjs-launcher": "^1.0.0",
"karma-phantomjs-shim": "^1.1.2",
"phantomjs-prebuilt": "^2.1.6",
"babel-plugin-istanbul": "^2.0.1",
"karma-webpack": "^1.7.0",
"webpack": "2.1.0-beta.25",
"html-webpack-plugin": "^2.9.0",
"style-loader": "^0.13.0",
"css-loader": "^0.23.1",
"postcss-loader": "^0.8.0",
"autoprefixer": "^6.2.2",
"json-loader": "^0.5.4",
"extract-text-webpack-plugin": "^2.0.0-beta.3",
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.6.0",
"react-hot-loader": "^1.3.0",
"sass-loader": "^3.1.2",
"node-sass": "^3.4.2",
"eslint": "^3.2.2",
"eslint-config-xo-space": "^0.12.0",
"babel-preset-react": "^6.1.18",
"eslint-config-xo-react": "^0.7.0",
"eslint-plugin-react": "^5.0.1",
"eslint-loader": "^1.3.0",
"babel-loader": "^6.2.0",
"babel-eslint": "^6.0.2",
"eslint-plugin-babel": "^3.1.0",
"babel-core": "^6.13.0",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.2.0"
},
"scripts": {
"build": "gulp",
"serve": "gulp serve",
"serve:dist": "gulp serve:dist",
"test": "gulp test",
"test:auto": "gulp test:auto"
},
"eslintConfig": {
"root": true,
"env": {
"browser": true,
"jasmine": true
},
"extends": [
"xo-react/space",
"xo-space/esnext"
]
}
}
'use strict';
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _reactDom = require('react-dom');
var _reactDom2 = _interopRequireDefault(_reactDom);
var _main = require('./app/main');
require('./index.scss');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
_reactDom2.default.render(_react2.default.createElement(_main.Main, null), document.getElementById('root'));
import React, {Component} from 'react';
import {Header} from './header';
import {Title} from './title';
import {Techs} from './techs/techs';
import {Footer} from './footer';
const styles = {
container: {
display: 'flex',
flexDirection: 'column',
minHeight: '100%'
},
main: {
flex: 1,
display: 'flex',
flexDirection: 'column'
}
};
export class Main extends Component {
render() {
return (
<div style={styles.container}>
<Header/>
<main style={styles.main}>
<Title/>
<Techs/>
</main>
<Footer/>
</div>
);
}
}
SystemJS.config({
packageConfigPaths: [
'npm:@*/*.json',
'npm:*.json',
'github:*/*.json'
],
map: {
'@angular/common': 'npm:@angular/common@2.1.1',
'@angular/compiler': 'npm:@angular/compiler@2.1.1',
'@angular/core': 'npm:@angular/core@2.1.1',
'@angular/http': 'npm:@angular/http@2.1.1',
/* ... */ /* ... */ /* ... */
'@angular/platform-browser': 'npm:@angular/platform-browser@2.1.1',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@2.1.1',
'@angular/router': 'npm:@angular/router@3.1.1',
'assert': 'github:jspm/nodelibs-assert@0.2.0-alpha',
'babel': 'npm:babel-core@6.17.0',
'buffer': 'github:jspm/nodelibs-buffer@0.2.0-alpha',
'child_process': 'github:jspm/nodelibs-child_process@0.2.0-alpha',
'constants': 'github:jspm/nodelibs-constants@0.2.0-alpha',
'core-js': 'npm:core-js@2.4.1',
'crypto': 'github:jspm/nodelibs-crypto@0.2.0-alpha',
'events': 'github:jspm/nodelibs-events@0.2.0-alpha',
'fs': 'github:jspm/nodelibs-fs@0.2.0-alpha',
'http': 'github:jspm/nodelibs-http@0.2.0-alpha',
'module': 'github:jspm/nodelibs-module@0.2.0-alpha',
'os': 'github:jspm/nodelibs-os@0.2.0-alpha',
'path': 'github:jspm/nodelibs-path@0.2.0-alpha',
'process': 'github:jspm/nodelibs-process@0.2.0-alpha',
'reflect-metadata': 'npm:reflect-metadata@0.1.8',
'rxjs': 'npm:rxjs@5.0.0-beta.12',
'stream': 'github:jspm/nodelibs-stream@0.2.0-alpha',
'string_decoder': 'github:jspm/nodelibs-string_decoder@0.2.0-alpha',
'timers': 'github:jspm/nodelibs-timers@0.2.0-alpha',
'url': 'github:jspm/nodelibs-url@0.2.0-alpha',
'util': 'github:jspm/nodelibs-util@0.2.0-alpha',
'vm': 'github:jspm/nodelibs-vm@0.2.0-alpha',
'zone.js': 'npm:zone.js@0.6.26'
},
packages: {
'npm:babel-core@6.17.0': {
'map': {
'babel-messages': 'npm:babel-messages@6.8.0',
'babel-code-frame': 'npm:babel-code-frame@6.16.0',
'babel-helpers': 'npm:babel-helpers@6.16.0',
'babel-generator': 'npm:babel-generator@6.17.0',
'babel-template': 'npm:babel-template@6.16.0',
'babel-register': 'npm:babel-register@6.16.3',
'shebang-regex': 'npm:shebang-regex@1.0.0',
'slash': 'npm:slash@1.0.0',
'babel-traverse': 'npm:babel-traverse@6.16.0',
'path-exists': 'npm:path-exists@1.0.0',
'babel-types': 'npm:babel-types@6.16.0',
'path-is-absolute': 'npm:path-is-absolute@1.0.1',
'babel-runtime': 'npm:babel-runtime@6.11.6',
'debug': 'npm:debug@2.2.0',
'minimatch': 'npm:minimatch@3.0.3',
'private': 'npm:private@0.1.6',
'lodash': 'npm:lodash@4.16.4',
'source-map': 'npm:source-map@0.5.6',
'convert-source-map': 'npm:convert-source-map@1.3.0',
'babylon': 'npm:babylon@6.13.0',
'json5': 'npm:json5@0.4.0'
}
},
'npm:babel-helpers@6.16.0': {
'map': {
'babel-template': 'npm:babel-template@6.16.0',
'babel-runtime': 'npm:babel-runtime@6.11.6'
}
},
'npm:babel-generator@6.17.0': {
'map': {
'babel-messages': 'npm:babel-messages@6.8.0',
'babel-types': 'npm:babel-types@6.16.0',
'babel-runtime': 'npm:babel-runtime@6.11.6',
'lodash': 'npm:lodash@4.16.4',
'source-map': 'npm:source-map@0.5.6',
'detect-indent': 'npm:detect-indent@3.0.1',
'jsesc': 'npm:jsesc@1.3.0'
}
},
'npm:babel-register@6.16.3': {
'map': {
'core-js': 'npm:core-js@2.4.1',
'babel-core': 'npm:babel-core@6.17.0',
'path-exists': 'npm:path-exists@1.0.0',
'babel-runtime': 'npm:babel-runtime@6.11.6',
'lodash': 'npm:lodash@4.16.4',
'home-or-tmp': 'npm:home-or-tmp@1.0.0',
'mkdirp': 'npm:mkdirp@0.5.1',
'source-map-support': 'npm:source-map-support@0.4.5'
}
},
'npm:babel-template@6.16.0': {
'map': {
'babel-traverse': 'npm:babel-traverse@6.16.0',
'babel-types': 'npm:babel-types@6.16.0',
'babel-runtime': 'npm:babel-runtime@6.11.6',
'lodash': 'npm:lodash@4.16.4',
'babylon': 'npm:babylon@6.13.0'
}
},
'npm:babel-messages@6.8.0': {
'map': {
'babel-runtime': 'npm:babel-runtime@6.11.6'
}
},
'npm:babel-traverse@6.16.0': {
'map': {
'babel-messages': 'npm:babel-messages@6.8.0',
'babel-code-frame': 'npm:babel-code-frame@6.16.0',
'babel-runtime': 'npm:babel-runtime@6.11.6',
'babel-types': 'npm:babel-types@6.16.0',
'debug': 'npm:debug@2.2.0',
'lodash': 'npm:lodash@4.16.4',
'babylon': 'npm:babylon@6.13.0',
'invariant': 'npm:invariant@2.2.1',
'globals': 'npm:globals@8.18.0'
}
},
'npm:babel-types@6.16.0': {
'map': {
'babel-runtime': 'npm:babel-runtime@6.11.6',
'lodash': 'npm:lodash@4.16.4',
'esutils': 'npm:esutils@2.0.2',
'to-fast-properties': 'npm:to-fast-properties@1.0.2'
}
},
'npm:babel-runtime@6.11.6': {
'map': {
'core-js': 'npm:core-js@2.4.1',
'regenerator-runtime': 'npm:regenerator-runtime@0.9.5'
}
},
'npm:babel-code-frame@6.16.0': {
'map': {
'esutils': 'npm:esutils@2.0.2',
'chalk': 'npm:chalk@1.1.3',
'js-tokens': 'npm:js-tokens@2.0.0'
}
},
'npm:rxjs@5.0.0-beta.12': {
'map': {
'symbol-observable': 'npm:symbol-observable@1.0.4'
}
},
'npm:debug@2.2.0': {
'map': {
'ms': 'npm:ms@0.7.1'
}
},
'npm:minimatch@3.0.3': {
'map': {
'brace-expansion': 'npm:brace-expansion@1.1.6'
}
},
'npm:source-map-support@0.4.5': {
'map': {
'source-map': 'npm:source-map@0.5.6'
}
},
'npm:chalk@1.1.3': {
'map': {
'escape-string-regexp': 'npm:escape-string-regexp@1.0.5',
'ansi-styles': 'npm:ansi-styles@2.2.1',
'has-ansi': 'npm:has-ansi@2.0.0',
'strip-ansi': 'npm:strip-ansi@3.0.1',
'supports-color': 'npm:supports-color@2.0.0'
}
},
'npm:home-or-tmp@1.0.0': {
'map': {
'os-tmpdir': 'npm:os-tmpdir@1.0.2',
'user-home': 'npm:user-home@1.1.1'
}
},
'npm:invariant@2.2.1': {
'map': {
'loose-envify': 'npm:loose-envify@1.2.0'
}
},
'npm:brace-expansion@1.1.6': {
'map': {
'concat-map': 'npm:concat-map@0.0.1',
'balanced-match': 'npm:balanced-match@0.4.2'
}
},
'npm:detect-indent@3.0.1': {
'map': {
'repeating': 'npm:repeating@1.1.3',
'get-stdin': 'npm:get-stdin@4.0.1',
'minimist': 'npm:minimist@1.2.0'
}
},
'npm:loose-envify@1.2.0': {
'map': {
'js-tokens': 'npm:js-tokens@1.0.3'
}
},
'npm:mkdirp@0.5.1': {
'map': {
'minimist': 'npm:minimist@0.0.8'
}
},
'npm:has-ansi@2.0.0': {
'map': {
'ansi-regex': 'npm:ansi-regex@2.0.0'
}
},
'npm:strip-ansi@3.0.1': {
'map': {
'ansi-regex': 'npm:ansi-regex@2.0.0'
}
},
'npm:repeating@1.1.3': {
'map': {
'is-finite': 'npm:is-finite@1.0.2'
}
},
'npm:is-finite@1.0.2': {
'map': {
'number-is-nan': 'npm:number-is-nan@1.0.1'
}
},
'github:jspm/nodelibs-stream@0.2.0-alpha': {
'map': {
'stream-browserify': 'npm:stream-browserify@2.0.1'
}
},
'github:jspm/nodelibs-buffer@0.2.0-alpha': {
'map': {
'buffer-browserify': 'npm:buffer@4.9.1'
}
},
'npm:stream-browserify@2.0.1': {
'map': {
'readable-stream': 'npm:readable-stream@2.1.5',
'inherits': 'npm:inherits@2.0.3'
}
},
'npm:readable-stream@2.1.5': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'isarray': 'npm:isarray@1.0.0',
'buffer-shims': 'npm:buffer-shims@1.0.0',
'core-util-is': 'npm:core-util-is@1.0.2',
'process-nextick-args': 'npm:process-nextick-args@1.0.7',
'string_decoder': 'npm:string_decoder@0.10.31',
'util-deprecate': 'npm:util-deprecate@1.0.2'
}
},
'npm:buffer@4.9.1': {
'map': {
'ieee754': 'npm:ieee754@1.1.8',
'isarray': 'npm:isarray@1.0.0',
'base64-js': 'npm:base64-js@1.2.0'
}
},
'github:jspm/nodelibs-http@0.2.0-alpha': {
'map': {
'http-browserify': 'npm:stream-http@2.4.0'
}
},
'npm:stream-http@2.4.0': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'readable-stream': 'npm:readable-stream@2.1.5',
'builtin-status-codes': 'npm:builtin-status-codes@2.0.0',
'to-arraybuffer': 'npm:to-arraybuffer@1.0.1',
'xtend': 'npm:xtend@4.0.1'
}
},
'github:jspm/nodelibs-timers@0.2.0-alpha': {
'map': {
'timers-browserify': 'npm:timers-browserify@1.4.2'
}
},
'github:jspm/nodelibs-crypto@0.2.0-alpha': {
'map': {
'crypto-browserify': 'npm:crypto-browserify@3.11.0'
}
},
'npm:crypto-browserify@3.11.0': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'browserify-cipher': 'npm:browserify-cipher@1.0.0',
'create-ecdh': 'npm:create-ecdh@4.0.0',
'browserify-sign': 'npm:browserify-sign@4.0.0',
'create-hash': 'npm:create-hash@1.1.2',
'create-hmac': 'npm:create-hmac@1.1.4',
'diffie-hellman': 'npm:diffie-hellman@5.0.2',
'public-encrypt': 'npm:public-encrypt@4.0.0',
'randombytes': 'npm:randombytes@2.0.3',
'pbkdf2': 'npm:pbkdf2@3.0.9'
}
},
'npm:timers-browserify@1.4.2': {
'map': {
'process': 'npm:process@0.11.9'
}
},
'npm:browserify-sign@4.0.0': {
'map': {
'create-hash': 'npm:create-hash@1.1.2',
'inherits': 'npm:inherits@2.0.3',
'create-hmac': 'npm:create-hmac@1.1.4',
'bn.js': 'npm:bn.js@4.11.6',
'elliptic': 'npm:elliptic@6.3.2',
'browserify-rsa': 'npm:browserify-rsa@4.0.1',
'parse-asn1': 'npm:parse-asn1@5.0.0'
}
},
'npm:create-hash@1.1.2': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'cipher-base': 'npm:cipher-base@1.0.3',
'sha.js': 'npm:sha.js@2.4.5',
'ripemd160': 'npm:ripemd160@1.0.1'
}
},
'npm:create-hmac@1.1.4': {
'map': {
'create-hash': 'npm:create-hash@1.1.2',
'inherits': 'npm:inherits@2.0.3'
}
},
'npm:diffie-hellman@5.0.2': {
'map': {
'randombytes': 'npm:randombytes@2.0.3',
'bn.js': 'npm:bn.js@4.11.6',
'miller-rabin': 'npm:miller-rabin@4.0.0'
}
},
'npm:public-encrypt@4.0.0': {
'map': {
'create-hash': 'npm:create-hash@1.1.2',
'randombytes': 'npm:randombytes@2.0.3',
'bn.js': 'npm:bn.js@4.11.6',
'browserify-rsa': 'npm:browserify-rsa@4.0.1',
'parse-asn1': 'npm:parse-asn1@5.0.0'
}
},
'npm:pbkdf2@3.0.9': {
'map': {
'create-hmac': 'npm:create-hmac@1.1.4'
}
},
'npm:create-ecdh@4.0.0': {
'map': {
'bn.js': 'npm:bn.js@4.11.6',
'elliptic': 'npm:elliptic@6.3.2'
}
},
'npm:browserify-cipher@1.0.0': {
'map': {
'browserify-des': 'npm:browserify-des@1.0.0',
'evp_bytestokey': 'npm:evp_bytestokey@1.0.0',
'browserify-aes': 'npm:browserify-aes@1.0.6'
}
},
'github:jspm/nodelibs-os@0.2.0-alpha': {
'map': {
'os-browserify': 'npm:os-browserify@0.2.1'
}
},
'npm:elliptic@6.3.2': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'bn.js': 'npm:bn.js@4.11.6',
'brorand': 'npm:brorand@1.0.6',
'hash.js': 'npm:hash.js@1.0.3'
}
},
'npm:browserify-des@1.0.0': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'cipher-base': 'npm:cipher-base@1.0.3',
'des.js': 'npm:des.js@1.0.0'
}
},
'npm:evp_bytestokey@1.0.0': {
'map': {
'create-hash': 'npm:create-hash@1.1.2'
}
},
'npm:browserify-rsa@4.0.1': {
'map': {
'bn.js': 'npm:bn.js@4.11.6',
'randombytes': 'npm:randombytes@2.0.3'
}
},
'npm:cipher-base@1.0.3': {
'map': {
'inherits': 'npm:inherits@2.0.3'
}
},
'npm:parse-asn1@5.0.0': {
'map': {
'create-hash': 'npm:create-hash@1.1.2',
'browserify-aes': 'npm:browserify-aes@1.0.6',
'evp_bytestokey': 'npm:evp_bytestokey@1.0.0',
'pbkdf2': 'npm:pbkdf2@3.0.9',
'asn1.js': 'npm:asn1.js@4.8.1'
}
},
'npm:miller-rabin@4.0.0': {
'map': {
'bn.js': 'npm:bn.js@4.11.6',
'brorand': 'npm:brorand@1.0.6'
}
},
'npm:browserify-aes@1.0.6': {
'map': {
'cipher-base': 'npm:cipher-base@1.0.3',
'create-hash': 'npm:create-hash@1.1.2',
'evp_bytestokey': 'npm:evp_bytestokey@1.0.0',
'inherits': 'npm:inherits@2.0.3',
'buffer-xor': 'npm:buffer-xor@1.0.3'
}
},
'npm:sha.js@2.4.5': {
'map': {
'inherits': 'npm:inherits@2.0.3'
}
},
'npm:hash.js@1.0.3': {
'map': {
'inherits': 'npm:inherits@2.0.3'
}
},
'npm:des.js@1.0.0': {
'map': {
'inherits': 'npm:inherits@2.0.3',
'minimalistic-assert': 'npm:minimalistic-assert@1.0.0'
}
},
'npm:asn1.js@4.8.1': {
'map': {
'bn.js': 'npm:bn.js@4.11.6',
'inherits': 'npm:inherits@2.0.3',
'minimalistic-assert': 'npm:minimalistic-assert@1.0.0'
}
},
'github:jspm/nodelibs-url@0.2.0-alpha': {
'map': {
'url-browserify': 'npm:url@0.11.0'
}
},
'github:jspm/nodelibs-string_decoder@0.2.0-alpha': {
'map': {
'string_decoder-browserify': 'npm:string_decoder@0.10.31'
}
},
'npm:url@0.11.0': {
'map': {
'punycode': 'npm:punycode@1.3.2',
'querystring': 'npm:querystring@0.2.0'
}
}
}
});
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;
};
define(["require", "exports", '@angular/core'], function (require, exports, core_1) {
"use strict";
var AppComponent = (function () {
function AppComponent() {
}
AppComponent = __decorate([
core_1.Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
})
], AppComponent);
return AppComponent;
}());
exports.AppComponent = AppComponent;
});
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular App</h1>'
})
export class AppComponent { }
<template>
<div class="example">{{ msg }}</div>
</template>
<script>
export default {
data () {
return {
msg: 'Hello world!'
}
}
}
</script>
<style>
.example {
color: red;
}
</style>
module.exports = {
entry: [
'webpack/hot/dev-server',
'webpack-hot-middleware/client',
`./${conf.path.src('index')}`
]
devtool: 'source-map',
module: {
loaders: [
{test: /.json$/, loaders: ['json']},
{test: /.js$/, exclude: /node_modules/, loader: 'eslint', enforce: 'pre'},
{test: /\.(css|scss)$/, loaders: ['style', 'css', 'sass', 'postcss']},
{test: /\.js$/, exclude: /node_modules/, loaders: ['react-hot', 'babel']}
]
},
plugins: [
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NoErrorsPlugin(),
new HtmlWebpackPlugin({
template: conf.path.src('index.html')
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.LoaderOptionsPlugin({
options: {
postcss: () => [autoprefixer]
},
debug: true
})
],
output: {
path: path.join(process.cwd(), conf.paths.tmp),
filename: 'index.js'
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment