Questions tagged [aurelia]

Aurelia is a next generation JavaScript client framework that leverages simple conventions to empower your creativity.

Aurelia
is a next generation JavaScript client framework that leverages simple conventions to empower your creativity.

Features

  • Forward-thinking
  • Modern Architecture
  • Two-Way Databinding
  • Extensible HTML
  • Routing & UI Composition
  • MV* with Conventions
  • Convention over Configuration
  • Broad Language Support
  • Testable

Community

Getting Started

Presentations

For the most up to date list refer to Awesome Aurelia (curated list of resources)

3402 questions
16
votes
2 answers

Deploying an aurelia.cli built app

I have built a simple aurelia web page without a back end, and I am now interested in going into production. I used Aurelia-cli for bundling, hoping this would be simple, but I am not sure how to proceed. Which files should I upload to the server to…
Luis Fominaya
  • 201
  • 2
  • 6
16
votes
1 answer

Getting the current route in Aurelia

To get the current route within a non-view-model class, would the best practice be to inject the Router and use this.router.history.fragment? Or is this a no-no?
Jeff G
  • 1,996
  • 1
  • 13
  • 22
16
votes
1 answer

Error handling for fetch() in Aurelia

I have an API that includes a useful description of what went wrong when an error is raised by the server (status = 500). The description comes as part of the response text. My client code, using Aurelia, calls the api via aurelia-fetch-client using…
AR.
  • 39,615
  • 9
  • 44
  • 52
16
votes
2 answers

Dynamically creating a class to use in modal

I have the following code which works for displaying a modal: app.html Test
TomSelleck
  • 6,706
  • 22
  • 82
  • 151
16
votes
2 answers

How do I upgrade my Durandal.js app to Aurelia?

I have an existing Durandal.js app that takes advantage of all of the ES5 features but I want to upgrade it to the new Aurelia platform. What is the proper upgrade path and what is the simplest way to upgrade up front with as least pain as…
PW Kad
  • 14,953
  • 7
  • 49
  • 82
15
votes
3 answers

Unexpected token m in JSON at position 0 error

On compiling an app and trying to implement the i18n library with webpack, I face this error: ERROR in ./node_modules/bundle-loader?lazy&name=lang-pt!./src/locales/pt/translation.json Module parse failed: Unexpected token m in JSON at position 0 You…
vascobento
  • 183
  • 1
  • 1
  • 7
15
votes
6 answers

Bootstrap 4 error "Bootstrap dropdown require Popper.js", with Aurelia CLI and Require.js

I'm having trouble configuring Bootstrap 4 beta in an Aurelia CLI app (v0.31.1) with requirejs and using TypeScript. After having tried several config variations I keep on getting the following console error: Uncaught Error: Bootstrap dropdown…
Juliën
  • 9,047
  • 7
  • 49
  • 80
15
votes
2 answers

Assisted injection in Aurelia?

I have a class whose constructor has two arguments; one is a dependency, the other is a configuration property: @inject(Dependency) class MyClass{ constructor(dependency, config){ } } How can I make use of Aurelia's dependency injection to…
Gorse horse
  • 5,093
  • 1
  • 20
  • 14
14
votes
1 answer

nginx config with spa and subdirectory root

I always seem to have problems with nginx configurations. My SPA is located at /mnt/q/app (pushstate is enabled) and the frontend root is located at client/public. Everything should be mapped to index.html, where the app picks up the route and…
marekpw
  • 662
  • 2
  • 5
  • 19
14
votes
3 answers

Aurelia router navigate & navigateToRoute

In app.ts I am looking to navigate to home/contract-view/10 on a action. Tried this.router.navigateToRoute(`home/contract-view`, { id: 10}, { absolute: true }); fails with Route home/contract-view not be found Another…
TSR
  • 714
  • 2
  • 7
  • 24
14
votes
6 answers

Convert ES6 Class with Symbols to JSON

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] =…
Jonesopolis
  • 25,034
  • 12
  • 68
  • 112
14
votes
2 answers

How to create a singleton service in Aurelia?

I'm pretty new to Aurelia (only been using it a few days) and I love it! I know how to make a service with Aurelia, but how can I make that service a singleton that I can then share data with between multiple ViewModels? Thanks
14
votes
1 answer

Array subscription in Aurelia

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 { …
Matthew James Davis
  • 12,134
  • 7
  • 61
  • 90
14
votes
1 answer

Aurelia project setup and folder structure in Visual Studio 2015: what goes in wwwroot?

I want to start playing with Aurelia and MVC 6 Web API with Visual Studio 2015 RC, and I'm using OdeToCode's blog post as a starting point. I understand the idea behind the new wwwroot folder, but I'm basically confused as to what should or…
Sergi Papaseit
  • 15,999
  • 16
  • 67
  • 101
14
votes
2 answers

Filter array in aurelia view

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:
Sayan Pal
  • 4,768
  • 5
  • 43
  • 82