Skip to content

Commit

Permalink
Update TreeDraggedElement service to use Angular 6+ providedIn sy…
Browse files Browse the repository at this point in the history
…ntax to improve tree-shaking / reduce bundle size

https://angular.io/guide/singleton-services#using-providedin
  • Loading branch information
Keith Gillette authored and tobiasengelhardt committed Jul 8, 2020
1 parent 62f0c02 commit 50dee1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@ import './polyfills';
providers: []
})
export class TreeModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: TreeModule,
providers: [TreeDraggedElement]
};
}
}

export {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class TreeDraggedElement {
_draggedElement: any = null;

Expand Down

0 comments on commit 50dee1b

Please sign in to comment.