aurelia

SystemJS (Aurelia with jspm) fails to load “aurelia-pal-browser” from jspm_packages folder

扶醉桌前 提交于 2019-11-30 19:56:26
I've followed the instructions at https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH , step 3-5 to install Aurelia in to my asp.net mvc core app (i.e. running npm install, jspm init, jspm install aurelia-framework and jspm install aurelia-bootstrapper). My "startup code" just looks like this for now: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> SystemJS.import('aurelia-bootstrapper'); </script> When I run the application I can see on Chrome dev tools that a lot of Aurelia resources (js files) are loaded under the /jspm

Reload current page in Aurelia

时光毁灭记忆、已成空白 提交于 2019-11-30 17:22:28
I have an Aurelia application where the user can select the company they're currently "working on". Every page in the app is dependent on the currently selected company, and the user can select a new company from a drop-down menu. The drop-down is a component sitting on the nav-bar. What I'd like is to have that component reload the current page on the change.delegate handler without restarting the app. So setting window.location.href is out of the question. Is there a way to force the aurelia Router to reload the current route/page? The alternative would be to use the EventAggregator to

Client side cache busting using the CLI

给你一囗甜甜゛ 提交于 2019-11-30 14:09:25
We're using the aurelia-cli . The tasks include these: build.json build.ts process-css.ts process-markup.ts process-sass.ts run.json run.ts test.json test.ts transpile.ts How if at all do we do a cache-busting solution the with cli? What we've tried already is to increment the number of the scripts directory, so that it goes scripts1 , scripts2 , scriptsN . Shaun Luttin 0.20.0 Support It's my lucky day. An aurelia-cli release from 8 hours ago says this: Features: Support bundle revision numbers Walkthru First, install 0.20.0 and create a new app. npm install aurelia-cli@">=0.20.0" -g au new my

How to use JQuery UI components in Aurelia getting started app (navigation app)

江枫思渺然 提交于 2019-11-30 09:23:18
I am able to run the Aurelia app by following the steps provided in getting started tutorial. They have used bootstrap nav-bar in the skeleton application. Is it possible to use JQuery UI components in the Aurelia app. If yes, please explain me how to achieve this. Thanks in advance. Yes, it's possible! I've made a jQueryUI Tabs example for you: tabs.html <template> <ul> <li repeat.for="tab of tabs"> <a href="${'#' + $parent.id + '-' + $index}">${tab.title}</a> </li> </ul> <div repeat.for="tab of tabs" id="${$parent.id + '-' + $index}"> <p>${tab.text}</p> </div> </template> As you can see, I

Filter array in aurelia view

余生颓废 提交于 2019-11-30 08:41:06
I am using aurelia and want to filter a collection (array) in view rather than in view model. I am trying the following syntax to do so: <div class="col-sm-7 col-md-7 col-lg-7 ${errors.filter(function(err){return err.Key==='car.Model';}).length >0? 'alert alert-danger' :''}"> <span repeat.for="error of errors"> <span if.bind="error.Key==='car.Model'"> ${error.Message} </span> </span> </div> And I am getting following error in browser console: Error: Parser Error: Missing expected ) at column 28 in [errors.filter(function(err){return err.Key==='car.Model';] . This is possible in angularJS as

Why does the alpha version of Aurelia load slowly?

。_饼干妹妹 提交于 2019-11-30 07:17:27
I wrote a minimal test page to try out Aurelia. http://www.andrewgolightly.com/ GitHub: https://github.com/magician11/ag-landingpage My last test, showed it took 55 seconds to load the page with 135 requests. It seems I need to bundle the jspm_packages directory first so that the 543KB gets downloaded at once.. and not in pieces. So given I followed this example: http://aurelia.io/get-started.html How do I bundle the packages? It's not clear to me from https://github.com/jspm/jspm-cli/wiki/Production-Workflows And then what do I update in my index.html file? And I'll still need to include the

Convert ES6 Class with Symbols to JSON

懵懂的女人 提交于 2019-11-30 07:01:05
问题 I have hardcoded classes to represent models in my Aurelia application. Here's a model 'PostEdit': var _postID = Symbol(); var _title = Symbol(); var _text = Symbol(); export class PostEdit { constructor(postEdit) { this[_postID] = postEdit.postID; this.title = postEdit.title; this.text= postEdit.text; } get postID() { return this[_postID]; } get title() { return this[_title]; } set title(val) { this[_title] = val; } get text() { return this[_text]; } set text(val) { this[_text] = val; } }

Custom element's Binding Context - what is it exactly, how to access parent VM

丶灬走出姿态 提交于 2019-11-30 04:19:36
问题 I couldn't find the answer in the docs, so I'm asking here. What exactly is the binding context passed to the bind method of custom element. Is it simply equal to router's currently active ViewModel ? At least, that's what I've found out so far. Why isn't it the element's parent (in the terms of DOM) VM? with this code @customElement("myelem") @inlineView("<template><content></content></template>") export class MyElem{ bind(ctx){ console.log(ctx); } } // welcome.html <myelem> <h3>inside

SystemJS (Aurelia with jspm) fails to load “aurelia-pal-browser” from jspm_packages folder

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 04:08:51
问题 I've followed the instructions at https://www.danylkoweb.com/Blog/getting-started-with-aurelia-in-aspnet-mvc-EH, step 3-5 to install Aurelia in to my asp.net mvc core app (i.e. running npm install, jspm init, jspm install aurelia-framework and jspm install aurelia-bootstrapper). My "startup code" just looks like this for now: <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script> SystemJS.import('aurelia-bootstrapper'); </script> When I run the application

Array subscription in Aurelia

自作多情 提交于 2019-11-30 01:21:38
Let's say I have an array of elements and in addition to displaying the list in my app, I want to sync the list to the server with HttpClient . How can I observe changes to the array? I tried: @inject(ObserverLocator) export class ViewModel { constructor(obsLoc) { this.list = []; obsLoc.getObserver(this, 'list'); .subscribe(li => console.log(li)); } } But I got neither error nor log message. Jeremy Danyow getObserver returns a property observer which will notify you when the ViewModel class instance's list property changes. This will only happen when you assign a new value to the list property