Refactor and fixes to Angular Directive #202
+25
−25
toddmotto
commented
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 systemHeadroomServiceto be dependency injected$documentwrapper overwindow.documentObjectif (options.scroller)that causes[object Window]errorangular.forEachwith native Object loop$destroycallback function to justheadroom.destroyargumentOne thing we need to discuss is integration of the isolate scope properties (
scope: {}etc):=, however this will not update the right properties currently inside theheadroominstance. One way to achieve this is setting up$scope.$watchon each property and registering the correct callback and property setter to achieve desired results.