(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// Somewhere in your controllers for this given example | |
// Example functions | |
$scope.itemOnLongPress = function(id) { | |
console.log('Long press'); | |
} | |
$scope.itemOnTouchEnd = function(id) { | |
console.log('Touch end'); | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Ember.Handlebars.registerBoundHelper('nl2br', function (text) { | |
var breakTag = '<br />'; | |
return new Handlebars.SafeString((text + '') | |
.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2')); | |
}); |
app.directive('someDirective', function () { | |
return { | |
scope: { | |
oneWay: '@', | |
twoWay: '=', | |
expr: '&' | |
} | |
}; | |
}); |
import { Component} from '@angular/core'; | |
import { Nl2BrPipe } from './nl2br.pipe'; | |
@Component({ | |
moduleId: module.id, | |
selector: 'my-component', | |
template: ` | |
<div [innerHtml]="content | nl2br"></div> | |
` |
const log = new Proxy({}, { | |
get: (_, colour) => function() { | |
console.log(`%c ${[].slice.call(arguments).join(' ')}`, `color: ${colour}`) | |
} | |
}) | |
// example | |
log.tomato('I am tomato') | |
log.chocolate('I am chocolate') | |
log.cornflowerblue('I am cornflowerblue') |