当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript provider.StateConfigProvider.addToRootState方法代码示例

本文整理汇总了TypeScript中core/navigation/state.provider.StateConfigProvider.addToRootState方法的典型用法代码示例。如果您正苦于以下问题:TypeScript provider.StateConfigProvider.addToRootState方法的具体用法?TypeScript provider.StateConfigProvider.addToRootState怎么用?TypeScript provider.StateConfigProvider.addToRootState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core/navigation/state.provider.StateConfigProvider的用法示例。


在下文中一共展示了provider.StateConfigProvider.addToRootState方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: module

module(INFRASTRUCTURE_STATES, [STATE_CONFIG_PROVIDER]).config((stateConfigProvider: StateConfigProvider) => {
  'ngInject';

  stateConfigProvider.addToRootState({
    name: 'search',
    url: '/search?q&key&tab&name&account&region&stack',
    params: {
      account: { dynamic: true, value: null },
      key: { dynamic: true, value: null },
      name: { dynamic: true, value: null },
      q: { dynamic: true, value: null },
      region: { dynamic: true, value: null },
      stack: { dynamic: true, value: null },
      tab: { dynamic: true, value: null },
    },
    views: {
      'main@': {
        template: `
          <infrastructure-search-v1 ng-if="$resolve.version == 1" class="flex-fill"></infrastructure-search-v1>
          <infrastructure-search-v2 ng-if="$resolve.version == 2" class="flex-fill"></infrastructure-search-v2>
        `,
      },
    },
    data: {
      pageTitleMain: {
        label: 'Search',
      },
    },
    resolve: {
      version: () => SETTINGS.searchVersion || 1,
    },
  });

  stateConfigProvider.addToRootState({ name: 'infrastructure', url: '/search?q', redirectTo: 'home.search' });
  stateConfigProvider.addRewriteRule('/infrastructure?q', '/search?q');
  stateConfigProvider.addRewriteRule('', '/search');
  stateConfigProvider.addRewriteRule('/', '/search');
});
开发者ID:mizzy,项目名称:deck,代码行数:38,代码来源:infrastructure.states.ts

示例2:

 (stateConfigProvider: StateConfigProvider) => {
   const styleguideState: INestedState = {
     url: '/styleguide',
     name: 'styleguide',
     views: {
       'main@': {
         templateUrl: '/styleguide.html',
       },
     },
     data: {
       pageTitleSection: {
         title: 'Styleguide',
       },
     },
   };
   stateConfigProvider.addToRootState(styleguideState);
 },
开发者ID:emjburns,项目名称:deck,代码行数:17,代码来源:styleguide.states.ts

示例3:

angular.module(STYLEGUIDE_STATES, [STATE_CONFIG_PROVIDER]).config((stateConfigProvider: StateConfigProvider) => {
  const styleguideState: INestedState = {
    url: '/styleguide',
    name: 'styleguide',
    views: {
      'main@': {
        templateUrl: '/styleguide.html',
      },
    },
    data: {
      pageTitleSection: {
        title: 'Styleguide',
      },
    },
  };
  stateConfigProvider.addToRootState(styleguideState);
});
开发者ID:mizzy,项目名称:deck,代码行数:17,代码来源:styleguide.states.ts

示例4: require

  .config((stateConfigProvider: StateConfigProvider) => {

  const styleguideState: INestedState = {
    url: '/styleguide',
    name: 'styleguide',
    views: {
      'main@': {
        templateUrl: require('../styleguide/public/styleguide.html')
      }
    },
    data: {
      pageTitleSection: {
        title: 'Styleguide'
      }
    }
  };
  stateConfigProvider.addToRootState(styleguideState);
});
开发者ID:jcwest,项目名称:deck,代码行数:18,代码来源:styleguide.states.ts

示例5: require

]).config((stateConfigProvider: StateConfigProvider) => {
  stateConfigProvider.addToRootState({
    name: 'infrastructure',
    url: '/infrastructure?q',
    reloadOnSearch: false,
    views: {
      'main@': {
        templateUrl: require('./infrastructure.html'),
        controller: 'InfrastructureCtrl',
        controllerAs: 'ctrl'
      }
    },
    data: {
      pageTitleMain: {
        label: 'Infrastructure'
      }
    }
  });
  stateConfigProvider.addRewriteRule('/', '/infrastructure');
});
开发者ID:brujoand,项目名称:deck,代码行数:20,代码来源:infrastructure.states.ts

示例6: require

]).config((applicationStateProvider: ApplicationStateProvider, stateConfigProvider: StateConfigProvider) => {

  const appState: INestedState = {
    name: 'analytics',
    url: '/analytics',
    reloadOnSearch: false,
    views: {
      'insight': {
        templateUrl: require('./application/appTableau.html'),
        controller: 'AppTableauCtrl as ctrl',
      }
    },
    data: {
      pageTitleSection: {
        title: 'Analytics'
      }
    },
  };

  const summaryState: INestedState = {
    name: 'analytics',
    url: '/analytics',
    reloadOnSearch: false,
    views: {
      'main@': {
        templateUrl: require('./summary/summaryTableau.html'),
        controller: 'SummaryTableauCtrl as ctrl',
      }
    },
    data: {
      pageTitleSection: {
        title: 'Analytics'
      }
    },
  };

  applicationStateProvider.addChildState(appState);
  stateConfigProvider.addToRootState(summaryState);
});
开发者ID:jtk54,项目名称:deck,代码行数:39,代码来源:tableau.states.ts

示例7:

]).config((stateConfigProvider: StateConfigProvider, applicationStateProvider: ApplicationStateProvider) => {

  const applicationsState: INestedState = {
    name: 'applications',
    url: '/applications',
    views: {
      'main@': {
        component: Applications, $type: 'react',
      }
    },
    data: {
      pageTitleMain: {
        label: 'Applications'
      }
    },
    children: [],
  };

  applicationStateProvider.addParentState(applicationsState, 'main@');
  stateConfigProvider.addToRootState(applicationsState);
  stateConfigProvider.addRewriteRule('/applications/{application}', '/applications/{application}/clusters');
});
开发者ID:robfletcher,项目名称:deck,代码行数:22,代码来源:applications.state.provider.ts

示例8: require

]).config((stateConfigProvider: StateConfigProvider, applicationStateProvider: ApplicationStateProvider) => {

  const applicationsState: INestedState = {
    name: 'applications',
    url: '/applications',
    views: {
      'main@': {
        templateUrl: require('../application/applications.html'),
        controller: 'ApplicationsCtrl',
        controllerAs: 'ctrl'
      }
    },
    data: {
      pageTitleMain: {
        label: 'Applications'
      }
    },
    children: [],
  };

  applicationStateProvider.addParentState(applicationsState, 'main@');
  stateConfigProvider.addToRootState(applicationsState);
  stateConfigProvider.addRewriteRule('/applications/{application}', '/applications/{application}/clusters');
});
开发者ID:brujoand,项目名称:deck,代码行数:24,代码来源:applications.state.provider.ts

示例9: require


//.........这里部分代码省略.........
          region: $stateParams.region,
          vpcId: $stateParams.vpcId,
        };
      }]
    },
    data: {
      pageTitleDetails: {
        title: 'Security Group Details',
        nameParam: 'name',
        accountParam: 'accountId',
        regionParam: 'region'
      },
      history: {
        type: 'securityGroups',
      },
    }
  };

  const securityGroupSummary: INestedState = {
    url: `/securityGroups?${stateConfigProvider.paramsToQuery(filterModelConfig)}`,
    name: 'securityGroups',
    views: {
      'nav': {
        template: '<security-group-filter app="$resolve.app"></security-group-filter>',
      },
      'master': {
        templateUrl: require('../securityGroup/all.html'),
        controller: 'AllSecurityGroupsCtrl',
        controllerAs: 'ctrl'
      }
    },
    params: stateConfigProvider.buildDynamicParams(filterModelConfig),
    data: {
      pageTitleSection: {
        title: 'Security Groups'
      }
    }
  };

  const standaloneSecurityGroup: INestedState = {
    name: 'securityGroupDetails',
    url: '/securityGroupDetails/:provider/:accountId/:region/:vpcId/:name',
    params: {
      vpcId: {
        value: null,
        squash: true,
      },
    },
    views: {
      'main@': {
        templateUrl: require('../presentation/standalone.view.html'),
        controllerProvider: ['$stateParams', 'cloudProviderRegistry',
          ($stateParams: StateParams,
           cloudProviderRegistry: CloudProviderRegistry) => {
            return cloudProviderRegistry.getValue($stateParams.provider, 'securityGroup.detailsController');
        }],
        controllerAs: 'ctrl'
      }
    },
    resolve: {
      resolvedSecurityGroup: ['$stateParams', ($stateParams: StateParams) => {
        return {
          name: $stateParams.name,
          accountId: $stateParams.accountId,
          provider: $stateParams.provider,
          region: $stateParams.region,
          vpcId: $stateParams.vpcId,
        };
      }],
      app: ['$stateParams', 'securityGroupReader', 'applicationModelBuilder',
        ($stateParams: StateParams,
         securityGroupReader: SecurityGroupReader,
         applicationModelBuilder: ApplicationModelBuilder): ng.IPromise<Application> => {
          // we need the application to have a security group index (so rules get attached and linked properly)
          // and its name should just be the name of the security group (so cloning works as expected)
          return securityGroupReader.loadSecurityGroups()
            .then((securityGroupsIndex) => {
              const application: Application = applicationModelBuilder.createStandaloneApplication($stateParams.name);
              application['securityGroupsIndex'] = securityGroupsIndex; // TODO: refactor the securityGroupsIndex out
              return application;
            });
      }]
    },
    data: {
      pageTitleDetails: {
        title: 'Security Group Details',
        nameParam: 'name',
        accountParam: 'accountId',
        regionParam: 'region'
      },
      history: {
        type: 'securityGroups',
      },
    }
  };

  applicationStateProvider.addInsightState(securityGroupSummary);
  applicationStateProvider.addInsightDetailState(securityGroupDetails);
  stateConfigProvider.addToRootState(standaloneSecurityGroup);
});
开发者ID:jcwest,项目名称:deck,代码行数:101,代码来源:securityGroup.states.ts

示例10: require


//.........这里部分代码省略.........
    children: [
      applicationFastPropertyDetails
    ]
  };

  const propInsights: INestedState = {
    name: 'propInsights',
    abstract: true,
    views: {
      'insight': {
        templateUrl: require('./mainApplicationProperties.html'),
      }
    },
    data: {
      pageTitleSection: {
        title: 'Fast Properties'
      }
    },
    children: [
      applicationFastProperty
    ]
  };

  const globalFastPropertyDetails: INestedState = {
    name: 'globalFastPropertyDetails',
    url: '/:propertyId',
    reloadOnSearch: true,
    views: {
      'detail@../data': {
        templateUrl: require('./view/fastPropertyDetails.html'),
        controller: 'FastPropertiesDetailsController',
        controllerAs: 'details'
      }
    },
    resolve: {
      fastProperty: ['$stateParams', ($stateParams: IPropertyDetailsStateParams) => {
        return {
          propertyId: $stateParams.propertyId,
        };
      }]
    },
    data: {
      pageTitleDetails: {
        title: 'Fast Property Details',
        propertyId: 'propertyId',
        accountParam: 'accountId',
        regionParam: 'region'
      },
      history: {
        type: 'properties',
      },
    }
  };


  const globalFastProperties: INestedState = {
    name: 'properties',
    url: '/properties',
    reloadOnSearch: false,
    views: {
      'master': {
        templateUrl: require('./view/properties.html'),
        controller: 'FastPropertiesController',
        controllerAs: 'fp'
      }
    },
    children: [
      globalFastPropertyDetails
    ]
  };

  const data: INestedState = {
    name: 'data',
    url: '/data',
    reloadOnSearch: false,
    views: {
      'main@': {
        templateUrl: require('./dataNav/main.html'),
      }
    },
    data: {
      pageTitleMain: {
        label: 'Properties'
      }
    },
    resolve: {
      app: (): any => {
        return null;
      }
    },
    children: [
      globalFastProperties,
      globalFastPropertyRollouts,
    ]
  };

  applicationStateProvider.addChildState(globalFastPropertyRollouts);
  applicationStateProvider.addChildState(propInsights);
  stateConfigProvider.addToRootState(data);
});
开发者ID:brujoand,项目名称:deck,代码行数:101,代码来源:fastProperties.states.ts


注:本文中的core/navigation/state.provider.StateConfigProvider.addToRootState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。