@Component({
selector: 'ng2-markdown',
inputs: [ 'source' ],
outputs: [ 'modified' ]
})
export class MyComponent {
constructor () {
| module.exports = { | |
| config: { | |
| // default font size in pixels for all tabs | |
| fontSize: 12, | |
| // font family with optional fallbacks | |
| fontFamily: '"SourceCodePro+Powerline+Awesome Regular","Roboto Mono for Powerline", "Meslo LG L DZ for Powerline", "Source Code Pro for Powerline", Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace', | |
| // terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
| cursorColor: 'rgba(248,28,229,0.8)', |
| <div class="alert alert-success"> | |
| <strong>Success!</strong> Success message</a>. | |
| </div> | |
| <div class="alert alert-info"> | |
| <strong>Info!</strong> Alert message</a>. | |
| </div> | |
| <div class="alert alert-warning"> | |
| <strong>Warning!</strong> Warning message</a>. | |
| </div> | |
| <div class="alert alert-danger"> |
| import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; | |
| // create a platform | |
| let platform = platformBrowserDynamic(); | |
| // save reference to the global object | |
| window['rootInjector'] = platform.injector; | |
| // boostrap application | |
| platform.bootstrapModule(AppModule); |
| /* style.css */ | |
| .flex-grid { | |
| display: flex; | |
| flex-wrap: wrap; | |
| justify-content: space-between; | |
| } | |
| .col { | |
| width: 32%; | |
| } |
| import { Subject, Observable } from 'rxjs'; | |
| class EventAggregator { | |
| constructor() { | |
| this.subject = new Subject(); // Can be ReplaySubject too | |
| } | |
| publish(type, data) { | |
| this.subject.onNext({ type, data }); | |
| } |
| # Default import from commonJS module | |
| ## ES6 | |
| import chai, { expect } from 'chai'; | |
| import chaiAsPromised from 'chai-as-promised'; | |
| chai.use(chaiAsPromised); | |
| ## Typescript |
| // beta.15 | |
| import { NgZone } from 'angular2/core'; | |
| constructor(nav, navParams, apiServer) { | |
| this.zone = new NgZone({ enableLongStackTrace: false }); | |
| } | |
| method() { | |
| this.zone.run(() => { |
| { | |
| "env": { | |
| "browser": true, | |
| "commonjs": true, | |
| "es6": true, | |
| "node": true | |
| }, | |
| "parserOptions": { | |
| "ecmaFeatures": { | |
| "jsx": true |
| { | |
| "env": { | |
| "browser": true, | |
| }, | |
| "ecmaFeatures": { | |
| "arrowFunctions": true, | |
| "blockBindings": true, | |
| "classes": true, | |
| "defaultParams": true, | |
| "destructuring": true, |