(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.
(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.
app.directive('infiniteScroll', [ | |
'$rootScope', '$window', '$timeout', function($rootScope, $window, $timeout) { | |
return { | |
link: function(scope, elem, attrs) { | |
var checkWhenEnabled, handler, scrollDistance, scrollEnabled; | |
$window = angular.element($window); | |
elem.css('overflow-y', 'scroll'); | |
elem.css('overflow-x', 'hidden'); | |
elem.css('height', 'inherit'); | |
scrollDistance = 0; |
angular.module('myApp') | |
.run(['$rootScope', function ($rootScope) { | |
window.i18n.init(options, function () { | |
// When finished loading translations, trigger re-evaluation of views for translations | |
$rootScope.$digest(); | |
}); | |
}]) | |
.filter('translate', [function(){ | |
return function(key, params) { | |
// i18next needs time to initialize (loading translations). In this phase translation does not work |
<!-- Flat ComboBox --> | |
<SolidColorBrush x:Key="ComboBoxNormalBorderBrush" Color="#e3e9ef" /> | |
<SolidColorBrush x:Key="ComboBoxNormalBackgroundBrush" Color="#fff" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledForegroundBrush" Color="#888" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBackgroundBrush" Color="#eee" /> | |
<SolidColorBrush x:Key="ComboBoxDisabledBorderBrush" Color="#888" /> | |
<ControlTemplate TargetType="ToggleButton" x:Key="ComboBoxToggleButtonTemplate"> | |
<Grid> | |
<Grid.ColumnDefinitions> |
/* | |
* twitter-entities.js | |
* This function converts a tweet with "entity" metadata | |
* from plain text to linkified HTML. | |
* | |
* See the documentation here: http://dev.twitter.com/pages/tweet_entities | |
* Basically, add ?include_entities=true to your timeline call | |
* | |
* Copyright 2010, Wade Simmons | |
* Licensed under the MIT license |
There was a [great article][1] about how react implements it's virtual DOM. There are some really interesting ideas in there but they are deeply buried in the implementation of the React framework.
However, it's possible to implement just the virtual DOM and diff algorithm on it's own as a set of independent modules.
angular.module('myApp') | |
.run(['$rootScope', function ($rootScope) { | |
window.i18n.init(options, function () { | |
// When finished loading translations, trigger re-evaluation of views for translations | |
$rootScope.$digest(); | |
}); | |
}]) | |
.filter('translate', [function(){ | |
return function(key, params) { | |
// i18next needs time to initialize (loading translations). In this phase translation does not work |
// --------------------------------------------- Promise Implementation | |
Promise = function () { | |
this._stack = []; | |
this._isResolved = false; | |
} | |
Promise.prototype = { | |
success: function(callback){ | |
// Is the promise already resolved? | |
if(this._isResolved) { | |
callback( this._result ); |
angular.module('ymusica').controller('AlbumSearch', ['$scope', 'Albums', 'Artists', '$q', function($scope, albums, artists, $q) { | |
$scope.albums = []; | |
$scope.artists = []; | |
var terms = new Rx.Subject(); | |
$scope.searchMusic = terms.onNext.bind(terms); | |
terms.sample(250) |