aurelia

Custom Attribute attached event too early?

ε祈祈猫儿з 提交于 2019-12-11 04:36:51
问题 The custom component I've created a custom component for the navigation of my app. It consists of an ul element and all its li elements are dynamically created based on the items in the router's navigation list. This is happening in the attached event of the component. Nothing special is going on here. The custom attribute But because I want to have a good looking fancy menu I also created a custom attribute and implemented it into the root ul element of the custom component. In the attached

Load aurelia-validation plugin during Jasmine unit tests - with webpack

喜欢而已 提交于 2019-12-11 03:28:22
问题 I am using Aurelia with Webpack. Based on the ESNext Skeleton Webpack. https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-esnext-webpack I have some plain JS model classes like: import {ValidationRules} from 'aurelia-validation'; export class Address { street = ''; } ValidationRules .ensure('street').required() .on(Address); As soon as I run my Jasmine tests (via Karma) and also with Wallaby, I get the error: 'Message: Did you forget to add ".plugin('aurelia-validation)" to

How to reference library already defined at app level in Aurelia ViewModel

℡╲_俬逩灬. 提交于 2019-12-11 02:47:11
问题 Sytemjs is defined in index.html so technically you can do System.import from anywhere in your application and it will work. However during the build, my component which dynamically imports a library when it is used, gives an error: error TS2304: Cannot find name 'System' Here is the component code: import { bindable, bindingMode, customElement, noView } from 'aurelia-framework'; @noView() @customElement('scriptinjector') export class ScriptInjector { @bindable public url; @bindable public

Aurelia using featherjs dependency failing to properly import feathers-socketio

梦想与她 提交于 2019-12-11 02:37:03
问题 How do you import featherjs-socketio using the technique common in Aurelia projects. A previous question helped me past the second dependency, but the last one seems to have the same fate as the first without a similar workaround. Aurelia using featherjs depency failing to properly import This is what I have: in the build file aurelia.json "dependencies": [ { "name": "socket.io-client", "path": "../node_modules/socket.io-client/dist/socket.io.min" }, { "name": "feathers-client", "path": "..

Error “Reflect.defineMetadata” while trying to load a transient web worker

蓝咒 提交于 2019-12-11 02:17:52
问题 I am trying to load the aurelia framework from inside a web worker in order to decorate the worker as transient. Here is the worker loader: importScripts('/jspm_packages/system.js'); System.config({ defaultJSExtensions: true, transpiler: 'none', paths: { 'npm:*': '/jspm_packages/npm/*' }, map: { 'aurelia-framework': 'npm:aurelia-framework@1.0.0-rc.1.0.1', 'aurelia-dependency-injection': 'npm:aurelia-dependency-injection@1.0.0-rc.1.0.0', 'aurelia-binding': 'npm:aurelia-binding@1.0.0-rc.1.0.2',

Passing objects to next sibling components

瘦欲@ 提交于 2019-12-11 00:16:37
问题 My structure in AureliaJS of components is: <parent> <child1> <child2> </parent> I have an object in child1 which I get with ajax requests: export class Child1 { fechedObject = {}: } I need this property with two-way binding and observable in the second component export class Child2 { // I need this fechedObject here } What is the best approach to get it? 回答1: I believe the best approach here is using two-way binding on both child models, to bind the model via two-way binding in the parent.

How to import ion-rangeslider in Aurelia

本秂侑毒 提交于 2019-12-10 23:43:10
问题 I am trying to use the ionRangeSlider plugin in Aurelia but am not sure how to make use of it. https://github.com/IonDen/ion.rangeSlider/issues I have jspm'd it into my project but how do I import it as well as call the one function that runs the plugin? 回答1: You will find the exact package names for including ion-rangesider in your package.json: jspm": { "dependencies": { ... "ion-rangeslider": "npm:ion-rangeslider@^2.1.3", "jquery": "npm:jquery@^2.2.3", ... } } Then you need to create your

JSPM - Are there any advantages/disadvantages in including client side library files using import vs using the script tag?

眉间皱痕 提交于 2019-12-10 23:23:50
问题 I'm starting to use JSPM in my Aurelia web projects and I want to know if there are any consequences or advantages in using the import "<client side library>" ? I've seen code like so for client side libraries inside JS classes : import "jquery"; import "bootstrap/css/bootstrap.css!" import "bootstrap"; export class App { constructor { } } Question: What is the difference/advantages/disadvantages between importing it this way as oppose to the traditional include of <script> and <link> tags in

How to deploy a web application Aurelia in an Apache server?

纵然是瞬间 提交于 2019-12-10 19:22:57
问题 To try, I used the latest "aurelia-skeleton-navigation 1.0.0-beta.1.0.1". To deploy the Aurelia web application in an Apache server I used "gulp export" command and I copied the contents of the "export" in the "www/html/myapp" directory ! So, the welcome tab works fine, but not the "github users" tab ! The error is : ERROR [app-router] Error: XHR error (404 Not Found) loading http://localhost/myapp/jspm_packages/github/github/fetch@0.10.1.js Error loading http://localhost/myapp/jspm_packages

Passing the parent when parent is the same component type in Aurelia

*爱你&永不变心* 提交于 2019-12-10 17:45:30
问题 Edit: This question used to be titled "Getting parent via DI when parent is the same type in Aurelia" but due to how my elements are nested, it makes more sense to just bind the parent to the element, so the title has been changed to reflect this. If I have a custom element, Thing which has a child Thing (which has a another child Thing , etc), how can I inject the parent instance when the class is the same? export class Thing { static inject = [Thing]; // <-- no reference to Thing as we are