aurelia-router

How to set default activationStrategy in aurelia

若如初见. 提交于 2019-11-29 10:13:48
Aurelia normally ignores any changes in the querystring. It is possible to set the activationStrategy to invoke-lifecycle in the VM so it will re-run the all the life cycles in the VM when the querystring changes. To prevent littering my code (placing it in every VM) i want to set the default activationStrategy to invoke-lifecycle . In the interface it's explained that it is possible, but how to set it? https://github.com/aurelia/router/blob/master/src/interfaces.js On the ViewModel (I misread your question at first too, but I'm leaving this in for completeness) Place a method

Aurelia: During a Router's Pipeline Step, how do I bind a variable to that router?

蓝咒 提交于 2019-11-29 07:20:28
I'd like to pass the user, found during the AuthorizeStep to either the App class and then to the home module . Here's what I have: export class App { configureRouter(config, router) { config.addPipelineStep('authorize', AuthorizeStep); config.map([ {route: ['', ':filter'], name: "", moduleId: 'welcome'} {route: 'home', name: "home", moduleId: 'home' auth:true} ]); this.router = router; } } class AuthorizeStep { run(routingContext, next) { if (routingContext.nextInstructions.some(i => i.config.auth)) { this.client.get('auth/login') .then(response => { this.user = response.content; }); } return

Configure IIS server to work with Aurelia framework and push state

强颜欢笑 提交于 2019-11-28 07:13:40
问题 I have created a basic aurelia app starting from this repo and I was trying to get rid of the # (hashtag) in the URL bar. I have 2 projects, one running WebApi on a machine and one running an empty web project (not MVC) on another machine. On the official documentation website it only says how to configure your routes but my project is not MVC oriented. How can I configure the IIS server from Web.config in a sense that when I access http://localhost/home it should start the aurelia framework

Linking directly to both parent+child views/controllers from the main navigation menu

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 05:29:17
问题 Consider this example: The main router is located in app.js someparent/childroute1 someparent/childroute2 route3 "someparent" is the "base controller and view". It has some reusable html markup in the view, custom elements and bindings which is to be shared by all its "child views and controllers". The child views and controllers will access these. Inside "someparent.html" there's (besides the shared markup) also a <router-view> tag, in which the child routes and pages should be rendered

Aurelia clear route history when switching to other app using setRoot

最后都变了- 提交于 2019-11-28 01:33:38
问题 The Aurelia router remembers which page I was last on, even after using setRoot() and it will redirect me to that page, even though I would want to land on the main app page again. I'll try to explain it in a usecase. I have two apps: login and app . I login in login app and get redirected to app . I navigate to /securedPage on app and then proceed to log out and get redirected to login again. I login with another user on login and then I get redirected to app/securedPage . I want to be and

Aurelia: During a Router's Pipeline Step, how do I bind a variable to that router?

社会主义新天地 提交于 2019-11-28 00:58:10
问题 I'd like to pass the user, found during the AuthorizeStep to either the App class and then to the home module . Here's what I have: export class App { configureRouter(config, router) { config.addPipelineStep('authorize', AuthorizeStep); config.map([ {route: ['', ':filter'], name: "", moduleId: 'welcome'} {route: 'home', name: "home", moduleId: 'home' auth:true} ]); this.router = router; } } class AuthorizeStep { run(routingContext, next) { if (routingContext.nextInstructions.some(i => i

How to switch between login page and app with Aurelia

余生长醉 提交于 2019-11-26 22:54:10
问题 I'm using the Aurelia skeleton for my project. Everything seemed so intuitive, however I'm stuck with a problem which I suspect is fairly easy (if you know how). The problem is that the app.html / app.js is initially showing a nav bar and loading some default styles. Now I need a login page, which does not load anything but its own styles, no navbar no nothing - just its own login form. So I tried something like this: app.js <template> <div if.bind="auth.isNotAuthenticated()"> <require from=