View ng2_dnd_todolist.js
onDrop(src: Todo, trg: Todo) { | |
this._moveRow(src.order, trg.order); | |
} | |
_moveRow(src, trg) { | |
src = parseInt(src); | |
trg = parseInt(trg); | |
// If the element was moved down | |
if (src > trg) { |
View ng2_dnd_todolist.html
<ul> | |
<todo *ngFor=”let todo of todos” [todo]=”todo” [makeDraggable]=”todo” makeDroppable (dropped)=”onDrop($event, todo)”></todo> | |
</ul> |
View ng2_dnd_makeDroppabel.js
@Directive({ | |
selector: '[makeDroppable]' | |
}) | |
export class MakeDroppable implements OnInit { | |
@Output() dropped: EventEmitter<any> = new EventEmitter(); | |
constructor(private _elementRef: ElementRef) {} | |
ngOnInit() { | |
let el = this._elementRef.nativeElement; |
View ng2_dnd_makeDraggable.js
@Directive({ | |
selector: '[makeDraggable]' | |
}) | |
export class MakeDraggable { | |
@Input('makeDraggable') data: any; | |
constructor(private _elementRef: ElementRef) {} | |
ngOnInit() { | |
// Get the current element |
View ng2_dnd ng cli
ng2 new ng2_dnd | |
ng2 serve |
View server.js
var express = require('express'), | |
app = express(), | |
bodyParser = require('body-parser'), | |
cookieParser = require('cookie-parser'), | |
session = require('express-session'), | |
passport = require('passport'), | |
wsfedsaml2 = require('passport-wsfed-saml2').Strategy; | |
passport.use('wsfed-saml2', new wsfedsaml2({ | |
realm: 'urn:node:app', |
View gist:170822fe46116879d9f9
binaries=( | |
node | |
git | |
) | |
echo "installing binaries..." | |
brew install ${binaries[@]} |
View branches
#new branch | |
git checkout -b <branchname> | |
#switch back to master | |
git checkout master |