aurelia

Aurelia CLI app-bundle automatic update gets slow

折月煮酒 提交于 2019-12-04 07:03:47
Hi I have a web application runnig on the Aurelia CLI. From what I’ve read in the documentation , the Aurelia CLI runs always “bundled” and never targeting directly source files. By running the “au run –watch” command, Aurelia “listens” to file changes and recreates the app-bundle.js automatically. Sample output from console: Starting 'readProjectConfiguration'... Finished 'readProjectConfiguration' Starting 'processMarkup'... Starting 'processCSS'... Starting 'configureEnvironment'... Finished 'configureEnvironment' Starting 'buildJavaScript'... Finished 'processCSS' Finished 'processMarkup'

Aurelia js fie upload to server

做~自己de王妃 提交于 2019-12-04 06:52:14
问题 Hi am new to aurelia js , i need to upload file to server,am using autrelia js, materializecss and httpClient.fetch for api call. I dont'know how to send file to server. view : <input type="file" files.bind="selectedFiles" change.delegate="onSelectFile($event)"> Model : onSelectFile(e) { var myurl = 'http://cdn.dmsapp.tk/file?authToken=bLNYMtfbHntfloXBuGlSPueilaHtZx&type=jpg&name=sibi.jpg&userId=7&organizationId=1&sourceType=USER_UPLOADS'; this.httpValueConverter.call_http(myurl,'POST',this

How can I change which files Aurelia-App looks for?

狂风中的少年 提交于 2019-12-04 05:12:42
I've initialised aurelia with <body aurelia-app> ... </body> The getting started guide ( http://aurelia.io/get-started.html ) says that this will, by default, try to load up app.js and app.html How can I tell aurelia to load up main.js and main.html? if I do <body aurelia-app="main"> only main.js is accessed and the view isn't shown. When you supply a value for the aurelia-app attribute, Aurelia will load that module and call the configure method that is exported by this module. This is explained in the documentation. Your configuration must tell Aurelia which module to load for the app root.

Two-Way binding in an Aurelia Custom Attribute

你说的曾经没有我的故事 提交于 2019-12-04 02:37:04
UPDATE: It looks like this is a known bug: https://github.com/aurelia/templating/issues/253 I am leaving it here for reference / searchability purposes. The Code: input-mask.ts (Full code can be seen here ) @customAttribute('input-mask') @inject(Element) export class InputMaskCustomAttribute { @bindable({ defaultBindingMode: bindingMode.twoWay, changeHandler: 'onUnmaskedValueChanged' }) unmaskedValue: any; onUnmaskedValueChanged(newValue, oldValue) { console.log('unmaskedValue updated from inside the custom attribute'); } @bindable mask: string; attached() { this.eventTarget.on('focusout', (e:

Aurelia - Inline definition of HTML-only custom element

我的未来我决定 提交于 2019-12-04 02:07:58
I have a recursive object in my Aurelia view model that looks like this: Class BottomlessPit { Name: string = ''; MorePits: BottomlessPit[] = null; } Therefore, I'd like to use a recursive template in my Aurelia view. It will only be used in one place, so I would rather use a template literal. Here's some pseudocode that doesn't work: <template name="pit"> <li> ${Name} <compose view.bind="pit" repeat.for="subpit of MorePits"></compose> </li> </template> Is this a feature of Aurelia? OK this hurt my head a little bit but here's a way to enable defining inline html-only custom elements... https:

Aurelia-Router: Modify route params and address bar from VM with Router

邮差的信 提交于 2019-12-04 00:59:09
问题 I want update the url-params in the address bar without routing. But i'm not sure how to do this with Aurelia-router from a view-model. In my case I send IDs in the url which gets picked up by the view-model's activate-method. The route looks like this: http://localhost:3000/#/test/products?0=2599037842&1=2599080552 Then I want to be able to remove IDs from the url without reactivating the view-model , url result exemple: http://localhost:3000/#/test/products?0=2599037842 Hopefully there is

Data binding parent-child relationships in Aurelia

我与影子孤独终老i 提交于 2019-12-03 15:35:47
The Code: I have two classes: export class Shipment { shipmentId: number; widget: Widget; } export class Widget { widgetId: number; name: string; } Then I have a ShipmentUi view-model that has an instance of shipment ( this.shipment ). And in the ShipmentUi view I compose part of the UI show the WidgetUi that allows selection of the Widget: <compose view-model="src/views/widgetUi" model.bind="shipment"></compose> The WigetUi's view-model saves off the shipment. So WidgetUi has a this.shipment . And then widgetUi's view shows a selector: <select value.bind="shipment.widget" > <option class=

Aurelia: How navigate between child routes

梦想的初衷 提交于 2019-12-03 15:25:34
I'm trying to navigate from one child route to another, but I continually get Route not found . My primary question: how to navigate between child views? Below is the code, and I'll have additional questions below, too. App Mode-View App Class: export class App { configureRouter(config, router) { config.title = 'My Site'; config.map([ { route: ['','job-view'], name: 'jobView', moduleId: './job-view', nav: true, title:'Jobs'}, { route: ['services'], name: 'services', moduleId: './services', nav: true, title:'Services'} ]); this.router = router; this.router.refreshNavigation(); } } Q.2 : Why do

Aurelia repeat.for access index of item

帅比萌擦擦* 提交于 2019-12-03 14:17:43
问题 I have a simple repeat.for: <li repeat.for="item of items">${item}</li> Currently I'm using: ${$parent.items.indexOf(item)} . Is there a shorthand, something like {{$index}} in angular? 回答1: There is. Write this: <li repeat.for="item of items">${$index} - ${item}</li> 来源: https://stackoverflow.com/questions/28418345/aurelia-repeat-for-access-index-of-item

Binding a select to an array of objects in Aurelia and matching on ID

隐身守侯 提交于 2019-12-03 12:25:30
So, I have a list of all users, which populates the options of a select. <option repeat.for="user of userService.users"> ${user.firstName} ${user.lastName} </option> And I have an incoming group record which has a list of users attached to it. I follow the cheat sheat instructions and bind it to a single index of the model. <select value.bind="group.users[0]"> <option repeat.for="user of userService.users" model.bind="user"> ${user.firstName} ${user.lastName} </option> </select> So, the incoming user in the group is identical to one of the users in the list: { id: 123, firstName: 'Matt',