本文整理汇总了TypeScript中aurelia-framework.PLATFORM类的典型用法代码示例。如果您正苦于以下问题:TypeScript PLATFORM类的具体用法?TypeScript PLATFORM怎么用?TypeScript PLATFORM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PLATFORM类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configureRouter
configureRouter(config: RouterConfiguration, router: Router) {
config.title = 'PEW.Web.App';
config.map([{
route: [ '', 'home' ],
name: 'home',
settings: { icon: 'home' },
moduleId: PLATFORM.moduleName('../home/home'),
nav: true,
title: 'Home'
}, {
route: 'counter',
name: 'counter',
settings: { icon: 'education' },
moduleId: PLATFORM.moduleName('../counter/counter'),
nav: true,
title: 'Counter'
}, {
route: 'fetch-data',
name: 'fetchdata',
settings: { icon: 'th-list' },
moduleId: PLATFORM.moduleName('../fetchdata/fetchdata'),
nav: true,
title: 'Fetch data'
}]);
this.router = router;
}
示例2: configureRouter
configureRouter(config: RouterConfiguration, router: Router): void {
config.map([
{route: ['', 'list'], moduleId: PLATFORM.moduleName('./list'), name: 'list'},
{route: 'edit/:id', moduleId: PLATFORM.moduleName('./edit'), name: 'edit'},
{route: 'create', moduleId: PLATFORM.moduleName('./edit'), name: 'create'}
]);
this.router = router;
}
示例3: 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();
}
示例4: configure
export function configure(aurelia: Aurelia) {
aurelia.use.standardConfiguration();
aurelia.use
.plugin(PLATFORM.moduleName('aurelia-google-maps'), (config: any) => {
config.options({
apiKey: 'AIzaSyCj-eGSewJFrmSuMg4WNU8FMhCDI4gP04Y', // use `false` to disable the key
apiLibraries: 'drawing,geometry', //get optional libraries like drawing, geometry, ... - comma seperated list
options: { panControl: true, panControlOptions: { position: 9 } }, //add google.maps.MapOptions on construct (https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapOptions)
language: 'en', // default: uses browser configuration (recommended). Set this parameter to set another language (https://developers.google.com/maps/documentation/javascript/localization)
region: 'US', // default: it applies a default bias for application behavior towards the United States. (https://developers.google.com/maps/documentation/javascript/localization)
markerCluster: {
enable: false,
src: 'https://cdn.rawgit.com/googlemaps/v3-utility-library/99a385c1/markerclusterer/src/markerclusterer.js', // self-hosting this file is highly recommended. (https://developers.google.com/maps/documentation/javascript/marker-clustering)
imagePath: 'https://cdn.rawgit.com/googlemaps/v3-utility-library/tree/master/markerclusterer/images/m', // the base URL where the images representing the clusters will be found. The full URL will be: `{imagePath}{[1-5]}`.`{imageExtension}` e.g. `foo/1.png`. Self-hosting these images is highly recommended. (https://developers.google.com/maps/documentation/javascript/marker-clustering)
imageExtension: 'png',
}
});
});
if (IS_DEV_BUILD) {
aurelia.use.developmentLogging();
}
new HttpClient().configure(config => {
const baseUrl = document.getElementsByTagName('base')[0].href;
config.withBaseUrl(baseUrl);
});
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app/components/app/app')));
}
示例5: configureRouter
configureRouter(config: RouterConfiguration, router: Router): void {
this.router = router;
config.title = "Aurelia";
config.map([
{ route: ["", "home"], name: "instagram", moduleId: PLATFORM.moduleName("instagram/index") },
]);
}
示例6: configure
export function configure(aurelia: Aurelia) {
aurelia.use.standardConfiguration().developmentLogging();
aurelia.use.feature(PLATFORM.moduleName("resources/index"));
aurelia.use.plugin(PLATFORM.moduleName('aurelia-bootstrap-datetimepicker'), config => {
// extra attributes, with config.extra
config.extra.iconBase = 'font-awesome';
config.extra.withDateIcon = true;
// or even any picker options, with config.options
config.options.format = 'YYYY-MM-DD';
config.options.showTodayButton = true;
});
aurelia.use.plugin(PLATFORM.moduleName('aurelia-bootstrap-select'));
aurelia.use.plugin(PLATFORM.moduleName('aurelia-bootstrap-tagsinput'));
aurelia.use.plugin(PLATFORM.moduleName('aurelia-validation'));
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}
示例7: configure
export async function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
await aurelia.start();
await aurelia.setRoot(PLATFORM.moduleName("app"));
}
示例8: function
let appRouterConfig: any = function(config: RouterConfiguration): void {
config.title = 'Aurelia';
config.addPipelineStep('authorize', AuthorizeStep); // Add a route filter to the authorize extensibility point.
config.map([
{ route: ['', 'welcome'], name: 'welcome', moduleId: PLATFORM.moduleName('./welcome'), nav: true, title: 'Welcome' },
{ route: 'child-router', name: 'child-router', moduleId: PLATFORM.moduleName('./child-router'), nav: true, title: 'Child Router' },
{ route: 'login', name: 'login', moduleId: PLATFORM.moduleName('./modules/auth/login'), nav: false, title: 'Login' },
{ route: 'logout', name: 'logout', moduleId: PLATFORM.moduleName('./modules/auth/logout'), nav: false, title: 'Logout' },
{ route: 'profile', name: 'profile', moduleId: PLATFORM.moduleName('./modules/auth/profile'), nav: false, title: 'Profile' },
{ route: 'signup', name: 'signup', moduleId: PLATFORM.moduleName('./modules/auth/signup'), nav: false, title: 'Signup' },
{ route: 'contacts', name: 'contacts', moduleId: PLATFORM.moduleName('./modules/contacts/index'), nav: true, title: 'Contacts', auth: true },
{ route: 'customers', name: 'customers', moduleId: PLATFORM.moduleName('./modules/customers/index'), nav: true, title: 'CRM', auth: true },
{ route: 'todos', name: 'todos', moduleId: PLATFORM.moduleName('./modules/todos/index'), nav: true, title: 'TODOs', auth: true }
]);
};
示例9: configureRouter
configureRouter(config: RouterConfiguration, router: Router) {
config.title = 'GeospatialSearch';
config.map([{
route: [ '', 'home' ],
name: 'home',
settings: { icon: 'home' },
moduleId: PLATFORM.moduleName('../home/home'),
nav: true,
title: 'Home'
}, {
route: 'counter',
name: 'counter',
settings: { icon: 'education' },
moduleId: PLATFORM.moduleName('../counter/counter'),
nav: true,
title: 'Counter'
}, {
route: 'fetch-data',
name: 'fetchdata',
settings: { icon: 'th-list' },
moduleId: PLATFORM.moduleName('../fetchdata/fetchdata'),
nav: true,
title: 'Fetch data'
}, {
route: 'geo-search-box',
name: 'geosearchbox',
settings: { icon: 'map-marker' },
moduleId: PLATFORM.moduleName('../geosearchbox/geosearchbox'),
nav: true,
title: 'Geo Search (Bounding Box)'
}, {
route: 'geo-search-point',
name: 'geosearchpoint',
settings: { icon: 'map-marker' },
moduleId: PLATFORM.moduleName('../geosearchpoint/geosearchpoint'),
nav: true,
title: 'Geo Search (Distance)'
}
]);
this.router = router;
}