This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AfterViewInit, Directive, ElementRef, NgZone, OnDestroy } from '@angular/core'; | |
import { NavigationEnd, NavigationStart, Router } from '@angular/router'; | |
import { Subscription } from 'rxjs/Subscription'; | |
import { ScrollTrackerService } from './scroll-tracker.service'; | |
@Directive({ | |
selector: '[scrollTracker]' | |
}) | |
export class ScrollTrackerDirective implements AfterViewInit, OnDestroy { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
app.directive('iconic', function() { | |
return { | |
restrict: 'A', | |
link: function(scope, element, attrs) { | |
scope.$watch(function() { | |
// Watch for the number of iconic DOM elements | |
return element.find('img.iconic').length; |