aurelia

Pass values to route

混江龙づ霸主 提交于 2019-12-12 07:53:36
问题 I have a list of items. When the user clicks on an item, the user will be taken to item details page. I want to pass an object containing item details(like item's image URL) to the route. However, I don't want to expose it in the routes url. If there were a way to do something like <a route-href="route: details; settings.bind({url: item.url})">${item.name}</a> that would be gold. I have seen properties can be passed to a route if defined in the route configuration. However, I don't know how

Aurelia @children decorator not working for grandchildren elements

早过忘川 提交于 2019-12-12 05:39:09
问题 I have a couple of custom elements that I laid out like this. I find that the @children decorator is giving me the 'items' array properly in the command-panel view-model, it has a size of 2 row-buttons (as expected). The problem I am seeing is in the @children 'buttons' array in the row-button view-model. It is always a size of 0! Can someone let me know what I am doing wrong? <command-panel label="Test" icon="fa-shield"> <row-button row-title="Row1"> <command-button btn-name="Force"><

Aurelia library js file in Bundle but is resolved as static file

此生再无相见时 提交于 2019-12-12 05:37:55
问题 My project structure is as follows: src ..lib ....someLibrary.js bundles.js: "bundles": { "dist/app-build": { "includes": [ "[**/*.js]", "**/*.html!text", "**/*.css!text" ], "options": { "sourceMaps": 'inline' "inject": true, "minify": true, "depCache": true, "rev": true } }, The project builds fine, but when I check app-build.js I don't find a definition for lib/someLibrary.js. I am using typescript for my own project so I assume this has something to do with that, how can I mix regular js

How can I change my API BaseUrl in Aurelia for development?

送分小仙女□ 提交于 2019-12-12 05:04:24
问题 I have the following in my app.ts constructor( container: Container ) { let client: HttpClient = new HttpClient; client.configure( config => { config.useStandardConfiguration() .withBaseUrl( 'http://localhost:8080/' ) .withDefaults( { credentials: 'include', headers: { Accept: 'application/json' } } ); } ); container.registerSingleton( HttpClient, () => client ); } the problem is http://localhost:8080 is only correct for local development, it should be / the rest of the time. This is because

How to incorporate Photoswipe with Aurelia

随声附和 提交于 2019-12-12 04:31:53
问题 I have a really hard time of integrating Photoswipe with Aurelia. I got compile time errors and browser errors. I looked at this question and tried what was suggested there (except the change of the typings file, because I don't know what to change), but still it is not working. With the information from the other question I managed to resolve the compile time errors but I still get an error when I initialize Photoswipe: Uncaught TypeError: photoswipe_1.default is not a constructor aurelia

Callback function in aurelia js

瘦欲@ 提交于 2019-12-12 04:31:09
问题 Am new to aurelia js. Here, i need to do callback in aurelia js . Here is the code i tried, file.js this.commonFunctions.get_alrdyShrdUser(this.alrdyshardAry,function(err,result){ if(!err){ console.log("err,result",err,result); this.sharedAlrdy = result; }else{ } }); commonFunctions get_alrdyShrdUser(docids,callback){ this.httpValueConverter.call_http('sharing/users/list','POST',docids,'test') .then(data => { if(data.meta && data.meta.statusCode == 200) { return callback(null,data.sharedUsers

How to wait BingMaps to be loaded in Aurelia

雨燕双飞 提交于 2019-12-12 04:28:55
问题 I am trying to use BingMaps in an Aurelia SPA. What I've done is to add BingMaps script tag to the Head section of the Index page. like this: <head> <meta charset="utf-8"> <script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=release'></script> </head> Then I have a Map template and Map controller like this: map.html <template> <div id='mainMap' style='width: 100vw; height: 100vh;'></div> </template> map.ts export class Map { map:Microsoft.Maps.Map; attached(){

Child router in custom element

筅森魡賤 提交于 2019-12-12 03:45:21
问题 I am trying to add a router to a custom element. The element should have two subviews where user can switch between them. However, I have run into a problem: export class customElement { configureRouter(config,router) { ... } //this is not getting called } This question is related and an answer to the question states that "It will not work if it is a custom element." Is there a workaround or is this just not possible? 回答1: This is not possible. Custom elements are not the same as routed view

How can I make Aurelia routing work when the application is not at the root of the host

半城伤御伤魂 提交于 2019-12-12 03:23:26
问题 I am building an Aurelia application that will not live at the root of the web site. Its URL will be something like this http://mycompany.com/neatoApp. I have a route configuration that looks like this {route:['','index'], name:'index',moduleId:'index' nave:true, title: 'neato app home'}, {route:['news'], name:'news',moduleId:'news' nave:true, title: 'neato app news'} I have System.js configured so that it knows /neatoApp is the baseURL and it downloads all the scripts and things properly. I

Docker Port Not Mapping

流过昼夜 提交于 2019-12-12 03:22:43
问题 I'm sorry if this turns out to be obvious, but I'm having a hard time accessing a dockerized server from outside the container on the host. Here's what I'm doing: I'm running the container with the following command: docker run -it --rm --name aurelia_dev -p 8888:8080 -v /Users/terskine/git/marvel/legendary:/app aurelia /bin/bash Within the container I'm running the app: cd app/ au run In a separate terminal, I can see the container is running: $ docker container ls CONTAINER ID IMAGE COMMAND