Skip to content

Commit 45d4103

Browse files
committed
Created a root provider function for UIRouter.
1 parent 4a8d1bb commit 45d4103

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/provideUiRouter.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core";
2+
import { locationStrategy, makeRootProviders, RootModule } from "./uiRouterNgModule";
3+
import { _UIROUTER_INSTANCE_PROVIDERS, _UIROUTER_SERVICE_PROVIDERS } from "./providers";
4+
5+
export function provideUIRouter(config: RootModule = {}): EnvironmentProviders {
6+
return makeEnvironmentProviders([
7+
_UIROUTER_INSTANCE_PROVIDERS,
8+
_UIROUTER_SERVICE_PROVIDERS,
9+
locationStrategy(config.useHash),
10+
...makeRootProviders(config),
11+
]);
12+
}

0 commit comments

Comments
 (0)