Refactor and fixes to Angular Directive #202
+25
−25
toddmotto
commented
toddmotto
changed the title from chore(angular.headroom): Restructure ng headroom to Refactor and fixes to Angular Directive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This PR restructures the Headroom Directive:
.factory()
to return the global dependency and register within Angular DI systemHeadroomService
to be dependency injected$document
wrapper overwindow.document
Objectif (options.scroller)
that causes[object Window]
errorangular.forEach
with native Object loop$destroy
callback function to justheadroom.destroy
argumentOne thing we need to discuss is integration of the isolate scope properties (
scope: {}
etc):=
, however this will not update the right properties currently inside theheadroom
instance. One way to achieve this is setting up$scope.$watch
on each property and registering the correct callback and property setter to achieve desired results.