aurelia

How to refresh bindings?

蹲街弑〆低调 提交于 2019-12-08 09:23:32
问题 I need to know how to refresh the bindings in Aurelia . I have been "Googling" for some time now, but can't seem to find the answer. The reason I need to refresh bindings is because some of the html (with click.delegate bindings) is generated after a call to server to retrieve data. I am updating a grid with some " Edit " and " Delete " buttons. Anyway, when I was using Durandal / KnockoutJS , I did the following: var body = this.element.find("tbody")[0]; if (body) { ko.cleanNode(body); ko

Aurelia router not working when resetting root

99封情书 提交于 2019-12-08 09:01:22
问题 I want to use aurelia-auth in my app and also have a login page that is completely separate from the rest of the app. I have been following the tutorial at this link: https://auth0.com/blog/2015/08/05/creating-your-first-aurelia-app-from-authentication-to-calling-an-api/ The problem I am having is after I successfully login and attempt to route to the app, none of the routes are found. I get route not found regardless of what I put in for the login redirect url. Here is my code: app.js: ...

Importing ElasticSearch into Aurelia

久未见 提交于 2019-12-08 08:56:53
问题 I'm trying to use elasticsearch-js within my Aurelia app but running into some trouble. After executing npm install elasticsearch , elasticsearch is installed under: app/node_modules/elasticsearch . In my app.js , I try to pull it in with import {elasticsearch} from 'elasticsearch'; and in the javascript console, I get the following error: system.src.js:4840 GET http://localhost:9000/dist/elasticsearch.js 404 (Not Found)D @ system.src.js:4840(anonymous function) @ system.src.js:4840Promise @

Define a route based on the path not on the hash value

落花浮王杯 提交于 2019-12-08 07:33:06
问题 The Aurelia router maps a route the the hash . http://subdomain.hostname.tld/pathA/pathB/pathC?queryKey=queryValue#hash How can we define an Aurelia route based on the pathA/pathB/pathC value instead? 回答1: Here's an example from the docs. But in order the #hash to work you'll need to specify config.options.hashChange as false: import {Redirect, NavigationInstruction, RouterConfiguration} from 'aurelia-router'; export class App { configureRouter(config: RouterConfiguration): void { config

How to import and use PhotoSwipe with Aurelia / Typescript?

允我心安 提交于 2019-12-08 06:37:51
问题 I am trying to use PhotoSwipe in an Aurelia project, but cannot find a way to make it work. In my aurelio.json under bundles, I have: { "name": "photoswipe", "path": "../node_modules/photoswipe/dist/", "main": "photoswipe.min", "resources": [ "photoswipe-ui-default.min.js", "photoswipe.css", "default-skin/default-skin.css" ] } in my package.json, I have: "@types/photoswipe": "^4.0.27", "photoswipe": "^4.1.1" in my .ts module, I have import PhotoSwipe from 'photoswipe'; The code I use for

Aurelia CLI PWA with Webpack and Workbox

心不动则不痛 提交于 2019-12-08 05:37:59
问题 Last night I attempted to create a PWA using the latest aurelia-cli (version 0.32.0). I created a custom setup with au new that uses Webpack and TypeScript. After that I followed the Workbox with Webpack instructions from Google. npm install workbox-cli --saveDev npm install workbox-webpack-plugin --saveDev service worker is running offline fails doesn't find webpack-dev-server.js (not in dist), app.xxx.bundle.js and vendor.asdf.js are not in the generated sw.js even though in dist folder au

Error retrieving jsonp from aurelia http client

喜夏-厌秋 提交于 2019-12-08 02:16:53
问题 I have an application I am creating using Aurelia. I wish to retrieve the latest images from a user in instagram via ajax. I tried using the Aurelia http client because that's what the Flickr example on Aurelia's getting started page uses. If I use http.get , then I get a CORS error from instagram. Trying http.jsonp , the inspected response shows the correct format, but I get what looks like a parsing error (Unexpected token ":") before the callback that handles the response is being executed

Aurelia: notification when ANY property is modified

為{幸葍}努か 提交于 2019-12-08 02:07:37
问题 Do you see any way to know when ANY model’s property has been modified through a binding? I would need something generic because it would be applied to all the forms of the application. This means I cannot just have a 'property’Changed() observable callback for every properties of the models. I’m thinking along the ways of overriding the properties setters created by the binding engine so they can call a single defined callback but I feel like there could be a better way. 回答1: I created a

Unable to use Aurelia plugin

风格不统一 提交于 2019-12-08 01:24:30
问题 I'm trying to move one of my custom elements into a plug-in so that I can re-use it across projects. I had a look at the skeleton plugin and noticed that it has a src/index.js that returns a config with all custom elements defined as globalResources . So I tried the same thing and I basically have: src/index.js export function configure (config) { config.globalResources([ './google-map', './google-map-location-picker', './google-map-autocomplete' ]); } And then I have each one of my custom

How to import packages within my Aurelia application

拈花ヽ惹草 提交于 2019-12-07 23:03:44
问题 I have a successful app running using Aurelia, however I developed it using VSCode and the skeleton that Aurelia gives you. Now that the CLI is available I'm trying to port the application over to a VS2015/Asp.net Core project but I'm having some difficulties. In the VSCode project, there's a bundles.js file within the build folder that Gulp uses to compile it (from what I understand). In that file, there's a "dist/aurelia" section and that's where I put all of the extra packages that I need