aurelia

How to access child router in Aurelia?

大城市里の小女人 提交于 2019-12-20 15:30:57
问题 I have two child routers. I can navigate from one to other. But from the child router view, how can I navigate? Below line of code gives the parent router instance. import {Router} from 'aurelia-router' How to get child router instance? 回答1: To create a child router, create a new router on a child route in the same way you created a router on the parent route. Then, set the router as a property of the view model class so you can access it throughout your view model. import { Router } from

How do I set/read a query string when using the router in aurelia?

时光怂恿深爱的人放手 提交于 2019-12-20 12:36:54
问题 When using the aurelia.io framework router, what is the preferred method for reading and setting a query string? For example, in the url: http://www.myapp.com/#/myroute1/?s=mystate How do I read and set the ?s=mystate part of the url and have the aurelia router navigate correctly and remember that state, such that whenever I arrive in my route1 viewmodel I can read that state variable and do something with it? 回答1: On viewmodel you can implement method activate(params, routeConfig) and object

Bootstrap 4 Beta importing Popper.js with Webpack 3.x throws Popper is not a constructor

北慕城南 提交于 2019-12-20 12:34:06
问题 So Bootstrap 4 Beta is out... yey! However Tether has been replaced by Popper.js for tooltip (and other features). I saw an error thrown in the console fast enough to advise me of the change to Popper.js : Bootstrap dropdown require Popper.js Seems easy enough, I went and updated my webpack.config.js (the entire config can be seen here) and Bootstrap then started working (the only change I did was to replace Tether with Popper): plugins: [ new ProvidePlugin({ 'Promise': 'bluebird', '$':

How to force binding re-evaluate or re-rendering in Aurelia

前提是你 提交于 2019-12-20 12:23:36
问题 I am starting with a simple TODO app with Aurelia, RethinkDB & Socket.IO. I seem to have problem with re-rendering or re-evaluating an object that is changed through Socket.IO. So basically, everything works good on the first browser but doesn't get re-rendered in the second browser while displaying the object in the console does show differences in my object. The problem is only on updating an object, it works perfectly on creating/deleting object from the array of todo items. HTML <ul> <li

Run Aurelia Framework without NodeJs and JSPM

会有一股神秘感。 提交于 2019-12-20 12:22:32
问题 I am learning Aurelia Framework. I seen its document given example in NodeJs and JSPM. But I don't have NodeJs and JSPM. I am from .Net background. Its possible to run Aurelia Framework without install NodeJS. I want run Aurelia Framework just like add tag and add CDN link. Its possible ? 回答1: You can write and execute Aurelia in Visual Studio without NodeJS or JSPM. Here is a port of the Aurelia skeleton-navigation to TypeScript which uses a bundle of the Aurelia AMD Libraries. You should be

Run Aurelia Framework without NodeJs and JSPM

廉价感情. 提交于 2019-12-20 12:20:12
问题 I am learning Aurelia Framework. I seen its document given example in NodeJs and JSPM. But I don't have NodeJs and JSPM. I am from .Net background. Its possible to run Aurelia Framework without install NodeJS. I want run Aurelia Framework just like add tag and add CDN link. Its possible ? 回答1: You can write and execute Aurelia in Visual Studio without NodeJS or JSPM. Here is a port of the Aurelia skeleton-navigation to TypeScript which uses a bundle of the Aurelia AMD Libraries. You should be

How to set up minimal Aurelia project from scratch

笑着哭i 提交于 2019-12-20 08:02:02
问题 When installing the Aurelia navigation skeleton app it is far to overwhelming with all the 3rd party modules and ready-made scripts it uses. For me who have a good picture of what most of it is in theory, have a hard time learning when I can't do it one step at a time. For this reason I would like to set up a minimal Aurelia project by myself and then add complexity to it as I go along. Main question: Which steps are necessary to set up a simple Aurelia project? Assumptions: I already have a

How to run SystemJs module when view loads

两盒软妹~` 提交于 2019-12-20 07:28:51
问题 I have a component that loads a javascript module that builds on Bootstrap.js and Jquery to automatically build a table of contents for a page based on H1,H2,... headers. The component code is as follows: import { bindable, bindingMode, customElement, noView } from 'aurelia-framework'; @noView() @customElement('scriptinjector') export class ScriptInjector { @bindable public url; @bindable public isLocal; @bindable public isAsync; @bindable({ defaultBindingMode: bindingMode.oneWay }) protected

How to dynamically build navigation menu from routes linking to parent/child views/controllers

末鹿安然 提交于 2019-12-20 06:32:59
问题 This question is a follow-up question for my original question Linking directly to both parent+child views/controllers from the main navigation menu The accepted answer is great, but later when I added a 2nd "childRoute" dynamically, I noticed a problem. In order to build my navigation dynamically I had to add the multiple routes with the same "route" attribute. (see app.js in the example code below). The only difference were the "title" and "settings" attributes. configureRouter(config,

Two way binding not working on bootstrap-select with aurelia

别等时光非礼了梦想. 提交于 2019-12-20 03:18:11
问题 I have managed to create a custom element to use the boostrap-select element. However, I can pass/bind values to it from the main view (parent) but I am unable to get the selection out from the element when I use two-way binding. My custom element is: import {inject, customElement, bindable} from 'aurelia-framework'; import * as selectpicker from 'bootstrap-select' @customElement('select-picker') export class BootStrapSelectPicker { @bindable selectableValues = null; @bindable newValue = null