How to use @nguniversal/common - 10 common examples

To help you get started, we’ve selected a few @nguniversal/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github patrickmichalina / fusing-angular / .dist / public / js / app.js View on Github external
AppModule = __decorate([
        core_1.NgModule({
            declarations: [
                app_component_1.AppComponent,
                home_component_1.TestComponent,
                home_component_1.HomeComponent,
                home_component_1.NotFoundComponent
            ],
            imports: [
                platform_browser_1.BrowserModule.withServerTransition({ appId: 'my-app' }),
                router_1.RouterModule.forRoot([
                    { path: '', component: home_component_1.HomeComponent },
                    { path: 'test', component: home_component_1.TestComponent }
                    // { path: '**', component: NotFoundComponent }
                ], { initialNavigation: true }),
                common_1.TransferHttpCacheModule
            ],
            providers: [],
            bootstrap: [app_component_1.AppComponent]
        })
    ], AppModule);
    return AppModule;
}());
exports.AppModule = AppModule;
github patrickmichalina / fusing-angular / .dist / server.js View on Github external
AppModule = __decorate([
        core_1.NgModule({
            declarations: [
                app_component_1.AppComponent,
                home_component_1.TestComponent,
                home_component_1.HomeComponent,
                home_component_1.NotFoundComponent
            ],
            imports: [
                platform_browser_1.BrowserModule.withServerTransition({ appId: 'my-app' }),
                router_1.RouterModule.forRoot([
                    { path: '', component: home_component_1.HomeComponent },
                    { path: 'test', component: home_component_1.TestComponent }
                    // { path: '**', component: NotFoundComponent }
                ], { initialNavigation: true }),
                common_1.TransferHttpCacheModule
            ],
            providers: [],
            bootstrap: [app_component_1.AppComponent]
        })
    ], AppModule);
    return AppModule;
}());
exports.AppModule = AppModule;
github angular / universal / modules / common / ls-routes / spec / ls-routes.spec.ts View on Github external
RouterModule.forRoot(routeConfig.map(r => assignComponent(r, MockComponent))),
    ],
    declarations: [MockComponent]
  })
  class MockModule { }
  @NgModule({
    imports: [
      ServerModule,
      MockModule,
      ModuleMapLoaderModule
    ]
  })
  class MockServerModule {}
  const factory = await compiler.compileModuleAsync(MockServerModule);

  return lsRoutes(factory, moduleMap);
}
github angular / universal / modules / express-engine / schematics / install / index.ts View on Github external
return () => {
    return chain([
      addUniversalCommonRule(options),
      addServerFile(options),
      addDependencies(options),
    ]);
  };
}
github angular / universal / modules / hapi-engine / schematics / install / index.ts View on Github external
return () => {
    return chain([
      addUniversalCommonRule(options),
      addServerFile(options),
      addDependencies(options),
    ]);
  };
}
github angular / universal / modules / express-engine / schematics / migrations / update-9 / index.ts View on Github external
return async host => {
    if (!getPackageJsonDependency(host, '@nguniversal/express-engine')) {
      throw new SchematicsException('Could not find dependency on @nguniversal/express-engine');
    }

    const collectionPath = require.resolve('../../collection.json');

    return version9UpdateRule(collectionPath);
  };
}
github angular / universal / modules / hapi-engine / schematics / migrations / update-9 / index.ts View on Github external
return async host => {
    if (!getPackageJsonDependency(host, '@nguniversal/hapi-engine')) {
      throw new SchematicsException('Could not find dependency on @nguniversal/hapi-engine');
    }

    const collectionPath = require.resolve('../../collection.json');

    return version9UpdateRule(collectionPath);
  };
}
github angular / universal / modules / hapi-engine / schematics / install / index.ts View on Github external
return async host => {
    const clientProject = await getProject(host, options.clientProject);
    const browserDistDirectory = await getOutputPath(host, options.clientProject, 'build');

    return mergeWith(
        apply(url('./files'), [
        template({
          ...strings,
          ...options,
          stripTsExtension,
          browserDistDirectory,
        }),
        move(clientProject.root)
      ])
    );
  };
}
github angular / universal / modules / express-engine / schematics / install / index.ts View on Github external
return async host => {
    const clientProject = await getProject(host, options.clientProject);
    const browserDistDirectory = await getOutputPath(host, options.clientProject, 'build');

    return mergeWith(
        apply(url('./files'), [
        template({
          ...strings,
          ...options,
          stripTsExtension,
          browserDistDirectory,
        }),
        move(clientProject.root)
      ])
    );
  };
}
github angular / universal / modules / express-engine / schematics / install / index.ts View on Github external
return async host => {
    const clientProject = await getProject(host, options.clientProject);
    const browserDistDirectory = await getOutputPath(host, options.clientProject, 'build');

    return mergeWith(
        apply(url('./files'), [
        template({
          ...strings,
          ...options,
          stripTsExtension,
          browserDistDirectory,
        }),
        move(clientProject.root)
      ])
    );
  };
}