AngularJS 1.4+ native implementation for jQuery slideToggle() using $animateCss.
A demo from article: http://blog.assaf.co/native-slide-toggle-for-angularjs-1-4-x/
A Pen by Shlomi Assaf on CodePen.
import { take } from 'rxjs/operators'; | |
import { Input, Directive, ElementRef, QueryList, OnDestroy, Optional, AfterViewInit } from '@angular/core'; | |
import { CdkDropList, CdkDrag, CdkDragHandle, CDK_DROP_LIST_CONTAINER } from '@angular/cdk/drag-drop'; | |
@Directive({ | |
selector: '[cdkLazyDropList]', | |
exportAs: 'cdkLazyDropList', | |
providers: [ | |
{ provide: CDK_DROP_LIST_CONTAINER, useExisting: CdkLazyDropList }, | |
], |
const reset$ = new Subject(); | |
// the API call we want to poll | |
const poller$ = myApi.getData() | |
.pipe(poll(reset$, 30000)); // 30 secs | |
// no polling yet... | |
const sub1 = poller$.subsbribe(data => console.log('POLL TICK 1') ); | |
const sub2 = poller$.subsbribe(data => console.log(' & 2') ); |
import { Directive } from '@angular/core'; | |
@Directive({ | |
selector: '[var]', | |
exportAs: 'var' | |
}) | |
export class VarDirective { | |
[key: string]: any; | |
} |
import { Directive, Input } from '@angular/core'; | |
@Directive({ | |
selector: '[var]', | |
exportAs: 'var' | |
}) | |
export class VarDirective { | |
[key: string]: any; | |
@Input('var') set assign(value : any) { |
# Flow: | |
# Find origin | |
# Find upstream URL | |
# Go to master | |
# Rebase upstream to master | |
# push changes to origin | |
# Make sure master has not pending changes for commit | |
# Some credits to an unknown source... |
AngularJS 1.4+ native implementation for jQuery slideToggle() using $animateCss.
A demo from article: http://blog.assaf.co/native-slide-toggle-for-angularjs-1-4-x/
A Pen by Shlomi Assaf on CodePen.
/* The body of the POST call to http://localhost:3000/api/posts */ | |
{ | |
"title": "This is a new post!", | |
"publishedDate": "2015-01-01T22:00:00.000Z", | |
"content": { | |
"brief": "Lets write a simple brief", | |
"extended": "<p>Maybe some extended info with html tags</p>" | |
} | |
} |
function readDir(start, callback) { | |
// Use lstat to resolve symlink if we are passed a symlink | |
fs.lstat(start, function(err, stat) { | |
if(err) { | |
return callback(err); | |
} | |
var found = {dirs: [], files: []}, | |
total = 0, | |
processed = 0; | |
function isDir(abspath) { |
app.config(function($provide) { | |
$provide.decorator('ngCellHasFocusDirective', function($delegate) { | |
var directive = $delegate[0]; | |
var original = directive.compile; | |
directive.compile = function(element, attrs) { | |
return function($scope, element) { | |
// state. | |
var isOn = false; |