Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { bootstrap } from '@angular/platform-browser-dynamic';
import { ROUTER_PROVIDERS } from '@angular/router-deprecated';
import { APP_BASE_HREF } from '@angular/common';
import * as App from './app/shared/index';
import { AppComponent } from './app/components/index';
import { AuthConfig, AuthHttp } from 'angular2-jwt/angular2-jwt';
import { provideStore } from '@ngrx/store';
import { MODAL_BROWSER_PROVIDERS } from 'angular2-modal/platform-browser/index';
if ('<%= ENV %>' === 'prod') { enableProdMode(); }
bootstrap(AppComponent, [
HTTP_PROVIDERS,
ROUTER_PROVIDERS,
MODAL_BROWSER_PROVIDERS,
provideStore(App.APP_STORE),
provide(APP_BASE_HREF, { useValue: '<%= APP_BASE %>' }),
provide(AuthHttp, {
useFactory: (http: Http) => {
return new AuthHttp(new AuthConfig({
noJwtError: true,
tokenName: 'jwt'
}), http);
},
deps: [Http]
}),
App.APP_PROVIDERS
]).catch(err => console.error(err));
// In order to start the Service Worker located at "./worker.js"
// uncomment this line. More about Service Workers here
// https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers
template: ''
})
export class MyApp {
rootPage: any = HomePage;
constructor(platform: Platform) {
platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
StatusBar.styleDefault();
});
}
}
ionicBootstrap(MyApp, [
provideStore(reducers),
//runEffects(effects),
services,
actions
]);
import { provideStore } from '@ngrx/store';
import { IAppState, IVrModule } from '../../interfaces';
import { LogService } from '../../services';
// Reducers
import { vrModuleReducer } from '../../reducers';
class AppStore implements IAppState {
public vrModule: IVrModule;
constructor(private logService: LogService) {
}
}
// Define App-Store
const appStore = provideStore(
{
vrModule: vrModuleReducer
},
{
vrModule: this.vrModule
});
export {
appStore
}
function createStore(reducer, monitorReducer = T => T){
const injector = ReflectiveInjector.resolveAndCreate([
provideStore(reducer),
instrumentStore(monitorReducer)
]);
const store = injector.get(Store);
const devtools = injector.get(StoreDevtools);
return { store, devtools };
}
export function provideIgoStore() {
return provideStore({
activeContext: activeContext,
editedContext: editedContext,
map: map,
layers: layers,
tools: tools,
toolHistory: toolHistory,
searchResults: searchResults,
selectedResult: selectedResult,
focusedResult: focusedResult
});
}
import services from './services';
import actions from './actions';
import guards from './guards';
bootstrap(App, [
/**
* provideStore is run once at application bootstrap, accepting a reducer
* function or object map of reducer functions. If passed an object of
* reducers, combineReducers will be run creating your application
* meta-reducer. This returns all providers for an @ngrx/store
* based application.
*
* Source: https://github.com/ngrx/store/blob/master/src/ng2.ts#L43-L69
*/
provideStore(reducer),
/**
* runEffects configures all providers for @ngrx/effects. Observables decorated
* as an @Effect() within the supplied services will ultimately be merged,
* with output of relevant (registered as effects) actions being
* dispatched into your application store. Any side-effects in
* your application should be registered as effects.
*
* Source: https://github.com/ngrx/effects/blob/master/lib/run-effects.ts#L8-L20
*/
runEffects(effects),
/**
* provideRouter sets up all of the providers for @angular/router. It accepts
* an array of routes and a location strategy. By default, it will use
* `PathLocationStrategy`.
beforeEach(() => {
TestBed.configureTestingModule({
providers: [AuthGuardService, provideStore(Store)]
});
});
import { provideStore } from '@ngrx/store';
import { playerReducer, timesReducer } from './player';
import { searchReducer } from './search';
import { tracklistsReducer } from './tracklists';
import { tracksReducer } from './tracks';
import { usersReducer } from './users';
export const STORE_PROVIDERS = provideStore({
player: playerReducer,
search: searchReducer,
times: timesReducer,
tracklists: tracklistsReducer,
tracks: tracksReducer,
users: usersReducer
});
beforeEach(function () {
ngTest.addProviders([ngrxStore.provideStore(ngrxStore.combineReducers({todos: reducers.todos, visibility: reducers.visibility}), {})]);
});