當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript aurelia-framework.FrameworkConfiguration類代碼示例

本文整理匯總了TypeScript中aurelia-framework.FrameworkConfiguration的典型用法代碼示例。如果您正苦於以下問題:TypeScript FrameworkConfiguration類的具體用法?TypeScript FrameworkConfiguration怎麽用?TypeScript FrameworkConfiguration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FrameworkConfiguration類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: configure

export function configure(frameworkConfig: FrameworkConfiguration, config: CoreConfig): Promise<void> {
	frameworkConfig.singleton(RouteMapper);
	frameworkConfig.globalResources([
		PLATFORM.moduleName("./routing/route-active/route-active.attribute"),
		PLATFORM.moduleName("./routing/route-href/route-href.attribute")
	]);

	Object.assign(routeActiveConfig, config.routeActive);
	return Promise.resolve();
}
開發者ID:sketch7,項目名稱:ssv-au-core,代碼行數:10,代碼來源:config.ts

示例2: configure

export function configure(frameworkConfig: FrameworkConfiguration, callback?: (config: PluginOptions) => void) {
  const logger = getLogger('aurelia-json-schema-form');

  logger.info('initializing aurelia-json-schema-form');

  // create defaults/apply user defined configuration
  const options = new PluginOptions();
  if (callback instanceof Function) {
    callback(options);
  }

  registerLogger(logger, options, frameworkConfig);

  registerConfiguration(logger, options, frameworkConfig);

  (frameworkConfig.container.get(RulesFactory) as RulesFactory).register();

  frameworkConfig.globalResources([
    PLATFORM.moduleName('./form/au-json-schema-form'),
    PLATFORM.moduleName('./value-converters/sf-number-value-converter'),
    PLATFORM.moduleName('./value-converters/sf-array-can-remove-value-converter'),
    PLATFORM.moduleName('./value-converters/sf-boolean-is-read-only-value-converter'),
    PLATFORM.moduleName('./form/array/sf-array'),
    PLATFORM.moduleName('./form/object/sf-object'),
    PLATFORM.moduleName('./form/number/sf-number'),
    PLATFORM.moduleName('./form/text/sf-string'),
    PLATFORM.moduleName('./form/boolean/sf-boolean'),
    PLATFORM.moduleName('./templates/bootstrap4/bootstrap-tooltip')
  ]);
}
開發者ID:jbockle,項目名稱:aurelia-json-schema-form,代碼行數:30,代碼來源:index.ts

示例3: configure

export function configure(aurelia: FrameworkConfiguration) {
    aurelia.globalResources([
        PLATFORM.moduleName('./tree-view/tree-node'),
        PLATFORM.moduleName('./tree-view/tree-node-template'),
        PLATFORM.moduleName('./tree-view/tree-view')
    ]);
}
開發者ID:Thanood,項目名稱:aurelia-tree-view,代碼行數:7,代碼來源:index.ts

示例4: configure

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
    PLATFORM.moduleName('./elements/bootstrap-tooltip'),
    PLATFORM.moduleName('./elements/loading-indicator'),
    PLATFORM.moduleName('./value-converters/date-format')
  ]);
}
開發者ID:ghiscoding,項目名稱:Realtime-TODO-Aurelia-RethinkDB,代碼行數:7,代碼來源:index.ts

示例5: configure

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
      "./elements/loading-indicator",
      "./elements/date-picker",
      "./dialogs/message-box",
      "./value-converters/dateFormat"
  ]);
}
開發者ID:rajajhansi,項目名稱:aspnetcore-aurelia-tutorial,代碼行數:8,代碼來源:index.ts

示例6: configure

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
    './number-value',
    './registration-form',
    './trigger-form',
    './validation-errors-form-one',
    './nullable-object-form'
  ]);
}
開發者ID:StrahilKazlachev,項目名稱:validation,代碼行數:9,代碼來源:index.ts

示例7: configure

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
    './components/nav-bar',
    './components/pagination.html',
    './components/list-search.html',

    './value-converters/upper'
  ]);
}
開發者ID:effervescentia,項目名稱:aurelia-sails-boilerplate-frontend,代碼行數:9,代碼來源:index.ts

示例8: configure

export function configure(fc: FrameworkConfiguration){
  fc.globalResources([
    './ui/elements/title-bar.html',
    './ui/elements/nav-bar',
    './ui/elements/post-summary',
    './ui/elements/post-object',
    './ui/elements/post-editor',
    './ui/command/command-ext',
    './ui/converters/common'
  ]);
}
開發者ID:avizcaino,項目名稱:avizcaino.github.io,代碼行數:11,代碼來源:index.ts

示例9: configure

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
    // elements
    // './elements/nav-bar',
    // './elements/pagination.html',

    // attributes
    // './attributes/authOnly',
    // './attributes/themeable'

    // binding behaviors
    // './throttleOnNetwork'

    // value converters
    // './value-converters/upperCase'
  ]);
}
開發者ID:effervescentia,項目名稱:generator-aurelia-sails,代碼行數:17,代碼來源:index.ts

示例10: configure

export function configure(config: FrameworkConfiguration, configCallback) {
  config.container.registerHandler('ui-validator', container => container.get(UIValidationRenderer));

  config.globalResources([
    './elements/core/ui-viewport',
    './elements/core/ui-page',
    './elements/core/ui-grid'
  ]);
  config.globalResources([
    './elements/components/ui-tab',
    './elements/components/ui-menu',
    './elements/components/ui-panel',
    './elements/components/ui-drawer',
    './elements/components/ui-tree',
    './elements/components/ui-datagrid'
  ]);
  config.globalResources([
    './elements/inputs/ui-button',
    './elements/inputs/ui-input',
    './elements/inputs/ui-option',
    './elements/inputs/ui-markdown',
    './elements/inputs/ui-list',
    './elements/inputs/ui-date'
  ]);
  config.globalResources([
    './attributes/ui-marked',
    './attributes/ui-badge'
  ]);
  config.globalResources([
    './value-converters/ui-text',
    './value-converters/ui-lodash'
  ]);

  var Configure = {
    title: (t) => {
      UIConstants.App.Title = t;
      return Configure;
    },
    version: (t) => {
      UIConstants.App.Version = t;
      return Configure;
    },
    appKey: (t) => {
      UIConstants.App.Key = t;
      return Configure;
    },
    apiUrl: (t) => {
      UIConstants.Http.BaseUrl = t;
      return Configure;
    },
    apiHeaders: (t) => {
      UIConstants.Http.Headers = t;
      return Configure;
    },
    sendAuthHeader: (t) => {
      UIConstants.Http.AuthorizationHeader = t;
      return Configure;
    },
    languages: (l) => {
      UIConstants.Languages = l;
      return Configure;
    }
  };

  if (configCallback !== undefined && typeof configCallback === 'function') {
    configCallback(Configure);
  }

  // Validation Rules
  ValidationRules
    .customRule('phone', (value, obj) => value === null || value === undefined || value === '' || PhoneLib.isValid(value), '\${$displayName } is not a valid phone number.');
  ValidationRules
    .customRule('integer', (value, obj, min, max) => value === null || value === undefined || value === '' || (Number.isInteger(value) && value >= (isEmpty(min) ? Number.MIN_VALUE : min) && value <= (isEmpty(max) ? Number.MAX_VALUE : max)),
    '\${$displayName} must be an integer value between \${$config.min} and \${$config.max}.', (min, max) => ({ min, max }));
  ValidationRules
    .customRule('decimal', (value, obj, min, max) => value === null || value === undefined || value === '' || (isNumber(value) && Math.floor(value % 1) === 0 && value >= (isEmpty(min) ? Number.MIN_VALUE : min) && value <= (isEmpty(max) ? Number.MAX_VALUE : max)),
    '\${$displayName} must be a decimal value between \${$config.min} and \${$config.max}.', (min, max) => ({ min, max }));
  ValidationRules
    .customRule('language', (map, obj, controller, langInput) => {
      if (!(langInput && langInput.addError && langInput.removeError)) throw new Error('Language validation must have reference to ui-language');
      let promises = [];
      _.forEach(map, (model, key) => {
        promises.push(controller.validator.validateObject(model)
          .then(e => {
            if (langInput.errors.indexOf(key) > -1) langInput.removeError(key);
            if (e.length > 0) langInput.addError(key);
            return e.length > 0 ? true : false;
          }));
      });
      return Promise.all(promises).then(e => _.filter(e).length == 0);
    }, 'Some language entries contain invalid values');

  // Setup kramed
  let rend = new kramed.Renderer();
  rend.code = (code, lang) => {
    if (window.hljs) {
      window.hljs.configure({
        useBR: true,
        tabReplace: '    '
      });
//.........這裏部分代碼省略.........
開發者ID:sigmaframeworks,項目名稱:sigma-ui-framework,代碼行數:101,代碼來源:index.ts


注:本文中的aurelia-framework.FrameworkConfiguration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。