本文整理汇总了TypeScript中aurelia-framework.Aurelia.setRoot方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Aurelia.setRoot方法的具体用法?TypeScript Aurelia.setRoot怎么用?TypeScript Aurelia.setRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurelia-framework.Aurelia
的用法示例。
在下文中一共展示了Aurelia.setRoot方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: configure
export async function configure(aurelia: Aurelia) {
console.log("configuring aurelia...");
aurelia.use
.standardConfiguration()
.developmentLogging();
// Uncomment the line below to enable animation.
// aurelia.use.plugin('aurelia-animator-css');
// if the css animator is enabled, add swap-order="after" to all router-view elements
// Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
// aurelia.use.plugin('aurelia-html-import-template-loader')
await aurelia.start();
aurelia.setRoot('app', document.getElementById("app"));
// if you would like your website to work offline (Service Worker),
// install and enable the @easy-webpack/config-offline package in webpack.config.js and uncomment the following code:
/*
const offline = await System.import('offline-plugin/runtime');
offline.install();
*/
}
示例2: configure
export async function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources/index'))
.developmentLogging();
aurelia.use.plugin(PLATFORM.moduleName('aurelia-bootstrap-datetimepicker'), config => {
config.extra.bootstrapVersion = 4;
config.extra.iconBase = 'font-awesome';
config.extra.withDateIcon = true;
});
aurelia.use.plugin(PLATFORM.moduleName('aurelia-auth/auth-filter'));
aurelia.use.plugin(PLATFORM.moduleName('aurelia-auth'), baseConfig => {
baseConfig.configure(authConfig);
});
// Uncomment the line below to enable animation.
// aurelia.use.plugin(PLATFORM.moduleName('aurelia-animator-css'));
// if the css animator is enabled, add swap-order="after" to all router-view elements
// Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
// aurelia.use.plugin(PLATFORM.moduleName('aurelia-html-import-template-loader'));
await aurelia.start();
await aurelia.setRoot(PLATFORM.moduleName('app'));
}
示例3: bootstrap
bootstrap(async (aurelia: Aurelia) => {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-api', config => {
config
.registerEndpoint('github', 'https://api.github.com/')
.registerEndpoint('api', 'http://localhost:3000/api/')
.setDefaultEndpoint('github');
})
.plugin('aurelia-orm', config => {
config.registerEntity(Customers)
config.registerEntity(User);
})
/* @see https://github.com/spoonx/aurelia-datatable */
.plugin('aurelia-datatable')
const rootElement = document.body;
rootElement.setAttribute('aurelia-app', '');
await aurelia.start();
aurelia.setRoot('app', rootElement);
// if you would like your website to work offline (Service Worker),
// install and enable the @easy-webpack/config-offline package in webpack.config.js and uncomment the following code:
/*
const offline = await System.import('offline-plugin/runtime');
offline.install();
*/
});
示例4: configure
async function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration();
await aurelia.start();
await aurelia.setRoot(PLATFORM.moduleName('app'));
}
示例5: configure
export async function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging()
.plugin('aurelia-materialize-bridge', bridge => bridge.useAll())
.plugin('aurelia-dialog', config => {
config.useDefaults();
config.settings.lock = true;
config.settings.centerHorizontalOnly = false;
config.settings.startingZIndex = 1005;
});
// Uncomment the line below to enable animation.
// aurelia.use.plugin('aurelia-animator-css');
// if the css animator is enabled, add swap-order="after" to all router-view elements
// Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
// aurelia.use.plugin('aurelia-html-import-template-loader')
await aurelia.start();
aurelia.setRoot('app');
// if you would like your website to work offline (Service Worker),
// install and enable the @easy-webpack/config-offline package in webpack.config.js and uncomment the following code:
/*
const offline = await System.import('offline-plugin/runtime');
offline.install();
*/
}
示例6: configure
export async function configure(aurelia: Aurelia) {
var authConfig = configureAuth();
aurelia.use
.plugin('aurelia-auth', (baseConfig) => {
baseConfig.configure(authConfig);
})
.plugin("aurelia-dialog", (config) => {
config.useDefaults();
})
// .developmentLogging()
.standardConfiguration();
// Uncomment the line below to enable animation.
// aurelia.use.plugin('aurelia-animator-css');
// if the css animator is enabled, add swap-order="after" to all router-view elements
// Anyone wanting to use HTMLImports to load views, will need to install the following plugin.
// aurelia.use.plugin('aurelia-html-import-template-loader')
await aurelia.start();
aurelia.setRoot('app');
// if you would like your website to work offline (Service Worker),
// install and enable the @easy-webpack/config-offline package in webpack.config.js and uncomment the following code:
/*
const offline = await System.import('offline-plugin/runtime');
offline.install();
*/
}
示例7: login
public async login() {
try {
this.token = await this.authService.login(this.username, this.password);
localStorage[Const.TOKEN_HEADER] = this.token;
this.aurelia.setRoot(Const.APP_ROOT);
} catch (error) {
this.error = error;
}
}
示例8:
.then(() => {
let config = aurelia.container.get(RouterConfig);
config.prepare();
let authService = aurelia.container.get(AuthService);
let root = authService.hasIdentity() ? 'app' : 'login';
aurelia.setRoot(root);
});
示例9: configure
export async function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.developmentLogging();
await aurelia.start();
await aurelia.setRoot(PLATFORM.moduleName("app"));
}
示例10:
(data: any) =>
{
if ( data.response === 'done' )
{
this.updateData();
this.aurelia.setRoot('app');
}
else
{
console.log( data )
}
}