How to use the angular2-universal.queryParamsToBoolean function in angular2-universal

To help you get started, we’ve selected a few angular2-universal 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 angular / universal / examples / src / server / hapi / routes.ts View on Github external
handler: (request, reply) => {
      let queryParams = queryParamsToBoolean(request.query);
      let options = Object.assign(queryParams, {
        // client url for systemjs
        buildClientScripts: true,
        componentUrl: 'examples/app/universal/test_page/browser',

        directives: [appPage.App],
        providers: [
          // HTTP_PROVIDERS,
          // SERVER_LOCATION_PROVIDERS,
          // provide(BASE_URL, {useExisting: req.originalUrl}),
          // provide(PRIME_CACHE, {useExisting: true})
        ],
        data: {},

        preboot: queryParams.preboot === false ? null : {
          start: true,
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngTemplateUrl(req, res) {

        let queryParams: any = queryParamsToBoolean(req.query);
        let options: BootloaderConfig = Object.assign(queryParams , {
          // client url for systemjs
          buildClientScripts: true,
          systemjs: {
            componentUrl: 'examples/src/universal/template_url/browser',
            map: {
              'angular2-universal': 'node_modules/angular2-universal',
              '@angular': 'node_modules/@angular'
            },
            packages: PACKAGES
          },
          // ngOnStable: () => {
          //   return new Promise(resolve => {
          //     setTimeout(() => {
          //       resolve();
          //     }, 500);
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngTodo(req, res) {
      let queryParams: any = queryParamsToBoolean(req.query);
      let options = Object.assign(queryParams , {
        // client url for systemjs
        buildClientScripts: true,
        systemjs: {
          componentUrl: 'examples/src/universal/falcor_todo/client',
          map: {
            'angular2-universal': 'node_modules/angular2-universal',
            '@angular': 'node_modules/@angular'
          },
          packages: PACKAGES
        },

        directives: [todoApp.TodoApp],
        providers: [
          // NODE_HTTP_PROVIDERS,
          // NODE_ROUTER_PROVIDERS,
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngApp(req, res) {
      let queryParams: any = queryParamsToBoolean(req.query);
      let options: BootloaderConfig = Object.assign(queryParams, {
        // client url for systemjs
        buildClientScripts: true,

        // directives: [appPage.App],
        directives: [ appPage.App, appPage.MyApp ],
        platformProviders: [
          provide(ORIGIN_URL, {useValue: 'http://localhost:3000'}),
          provide(BASE_URL, {useValue: '/'}),
        ],
        providers: [
          provide(REQUEST_URL, {useValue: req.originalUrl}),

          ...NODE_PLATFORM_PIPES,
          ...NODE_ROUTER_PROVIDERS,
          ...NODE_HTTP_PROVIDERS,
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngJsonp(req, res) {
          let queryParams: any = queryParamsToBoolean(req.query);
          let options: BootloaderConfig = Object.assign(queryParams , {
            // client url for systemjs
            buildClientScripts: true,
            systemjs: {
              componentUrl: 'examples/src/universal/test_jsonp/browser',
              map: {
                'angular2-universal': 'node_modules/angular2-universal',
                '@angular': 'node_modules/@angular'
              },
              packages: PACKAGES
            },
            directives: [jsonpApp.App],
            platformProviders: [
              provide(ORIGIN_URL, {useValue: 'http://localhost:3000'}),
              provide(BASE_URL, {useValue: '/examples/jsonp'})
            ],
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngHtml(req, res) {
        let queryParams: any = queryParamsToBoolean(req.query);
        let options: BootloaderConfig = Object.assign(queryParams , {
          // client url for systemjs
          directives: [htmlApp.Html],
          platformProviders: [
            provide(ORIGIN_URL, {useValue: 'http://localhost:3000'}),
            provide(BASE_URL, {useValue: '/'})
          ],
          providers: [
            provide(REQUEST_URL, {useValue: req.originalUrl}),

            NODE_PLATFORM_PIPES,
            NODE_ROUTER_PROVIDERS,
            NODE_HTTP_PROVIDERS,
            provide(LocationStrategy, { useClass: HashLocationStrategy })
          ],
          data: {},
github angular / universal / examples / src / server / express / routes.ts View on Github external
.get(function ngTodo(req, res) {
      let queryParams: any = queryParamsToBoolean(req.query);
      let options: BootloaderConfig = Object.assign(queryParams , {
        // client url for systemjs
        buildClientScripts: true,
        systemjs: {
          componentUrl: 'examples/src/universal/todo/browser',
          map: {
            'angular2-universal': 'node_modules/angular2-universal',
            '@angular': 'node_modules/@angular'
          },
          packages: PACKAGES
        },
        directives: [todoApp.TodoApp],
        platformProviders: [
          provide(ORIGIN_URL, {useValue: 'http://localhost:3000'}),
          provide(BASE_URL, {useValue: '/examples/todo'}),
        ],
github angular / universal / examples / src / server / express / routes.ts View on Github external
function ngRouter(req, res) {
    let baseUrl = '/examples/router';
    let url = req.originalUrl.replace(baseUrl, '') || '/';
    let queryParams: any = queryParamsToBoolean(req.query);

    let options: BootloaderConfig = Object.assign(queryParams , {
      // client url for systemjs
      buildClientScripts: true,
      systemjs: {
        componentUrl: 'examples/src/universal/test_router/browser',
        map: {
          'angular2-universal': 'node_modules/angular2-universal',
          '@angular': 'node_modules/@angular'
        },
        packages: PACKAGES
      },
      // ensure that we test only server routes
      client: false,

      directives: [routerApp.App],
github justindujardin / ng2-material / example / src / server.ts View on Github external
function ngRouter(req, res) {
  let baseUrl = '/';
  let url = req.originalUrl.replace(baseUrl, '') || '/';
  let queryParams: any = queryParamsToBoolean(req.query);

  let options = Object.assign(queryParams, {
    directives: [App, MATERIAL_DIRECTIVES, DEMO_DIRECTIVES],
    providers: [
      provide(APP_BASE_HREF, {useValue: baseUrl}),
      provide(BASE_URL, {useValue: path.resolve(__dirname)}),
      provide(REQUEST_URL, {useValue: path.resolve(__dirname)}),
      provide(UrlResolver, {useValue: new NodeUrlResolver}),
      NODE_ROUTER_PROVIDERS,
      NODE_HTTP_PROVIDERS,
    ],
    platformProviders: [MATERIAL_NODE_PROVIDERS],
    componentProviders: [DEMO_PROVIDERS],
    data: {},

    preboot: null