@Component({
selector: 'ng2-markdown',
inputs: [ 'source' ],
outputs: [ 'modified' ]
})
export class MyComponent {
constructor () {
npm config set proxy <your proxy server address:port> | |
npm config set https-proxy <your proxy server address:port> | |
npm config set registry=http://registry.npmjs.org/ | |
git config --global url."https://".insteadOf git:// | |
set http_proxy=<your proxy server address:port> | |
set https_proxy=<your proxy server address:port> | |
or create .bowerrc |
npm install -g rimraf | |
rimraf <dir> |
# Deployment | |
# ---------- | |
echo Handling node.js grunt deployment. | |
# 1. Select node version | |
selectNodeVersion | |
# 2. Install npm packages | |
if [ -e "$DEPLOYMENT_SOURCE/package.json" ]; then |
git filter-branch -f --index-filter "git rm -rf --cached --ignore-unmatch FOLDERNAME" -- --all | |
Replace FOLDERNAME with the file or folder you wish to remove from the given git repository. | |
Once this is done run the following commands to clean up the local repository | |
rm -rf .git/refs/original/ | |
git reflog expire --expire=now --all | |
git gc --prune=now | |
git gc --aggressive --prune=now |
{ | |
"env": { | |
"browser": true, | |
}, | |
"ecmaFeatures": { | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"classes": true, | |
"defaultParams": true, | |
"destructuring": true, |
{ | |
"env": { | |
"browser": true, | |
"commonjs": true, | |
"es6": true, | |
"node": true | |
}, | |
"parserOptions": { | |
"ecmaFeatures": { | |
"jsx": true |
// beta.15 | |
import { NgZone } from 'angular2/core'; | |
constructor(nav, navParams, apiServer) { | |
this.zone = new NgZone({ enableLongStackTrace: false }); | |
} | |
method() { | |
this.zone.run(() => { |
# Default import from commonJS module | |
## ES6 | |
import chai, { expect } from 'chai'; | |
import chaiAsPromised from 'chai-as-promised'; | |
chai.use(chaiAsPromised); | |
## Typescript |
import { Subject, Observable } from 'rxjs'; | |
class EventAggregator { | |
constructor() { | |
this.subject = new Subject(); // Can be ReplaySubject too | |
} | |
publish(type, data) { | |
this.subject.onNext({ type, data }); | |
} |