aurelia

Aurelia router view animation with swap-order=“with”

可紊 提交于 2020-02-01 04:18:05
问题 I am using aurelia-animator-css to animate router views. Upon navigation to a new router view, I want the current view to slide off screen to the left while the new view slides onto the screen from the right. Here is my router-view element: <router-view swap-order="with"></router-view> Here is the top element in each of the views: <div class="pages au-animate"> And here is the css: @keyframes slideLeftIn { 0% { transform: translate(100%, 0); } 100% { transform: translate(0, 0); } } @keyframes

Aurelia: How navigate between child routes

三世轮回 提交于 2020-01-22 14:49:46
问题 I'm trying to navigate from one child route to another, but I continually get Route not found . My primary question: how to navigate between child views? Below is the code, and I'll have additional questions below, too. App Mode-View App Class: export class App { configureRouter(config, router) { config.title = 'My Site'; config.map([ { route: ['','job-view'], name: 'jobView', moduleId: './job-view', nav: true, title:'Jobs'}, { route: ['services'], name: 'services', moduleId: './services',

Multiple Aurelia apps on one page

我们两清 提交于 2020-01-20 08:24:03
问题 As there isn't much information about Aurelia framework I got stuck with these 2 questions. Is it possible to create multiple Aurelia apps on single page and how this can be achieved? Alternatively is there a way to call out single application templates in 2 different places outside the main app container? For example I want to use Aurelia SPA in CMS system and call it out in different elements like header, main container and aside container. 回答1: Yep, just add two elements to the page with

Multiple Aurelia apps on one page

偶尔善良 提交于 2020-01-20 08:22:29
问题 As there isn't much information about Aurelia framework I got stuck with these 2 questions. Is it possible to create multiple Aurelia apps on single page and how this can be achieved? Alternatively is there a way to call out single application templates in 2 different places outside the main app container? For example I want to use Aurelia SPA in CMS system and call it out in different elements like header, main container and aside container. 回答1: Yep, just add two elements to the page with

Using AMD module as an Aurelia ViewModel

孤者浪人 提交于 2020-01-15 07:27:10
问题 I was playing with Aurelia and seems pretty nice, I use Durandal for some projects and this definitively suit my needs. Use the new class definition from EC6 is awesome. But now I'm preparing something in which I need to use a classic AMD modules with requireJs, something like this one: define("testModule", [], function() { "use strict"; console.log('testModule loaded'); var testModule = function() { var that = this; this.variable = 10; that.getVariable = function(){ alert('function executed

Aurelia ValueConverter fromView confusion with multi-select

混江龙づ霸主 提交于 2020-01-15 07:18:28
问题 I'm trying to use and understand the Aurelia ValueConverter in the context of a multi-select form. What I thought would be straight forward, has turned out to be a challenge for me. I have a form to create a new deal which has multiple categories assigned to it via a multi-select input field. I've bound the output from the form into new_deal.categorizations (in the database deals have categories through categorizations). Right now on create, through a 'brute force' method, I'm converting each

How can I ask users to confirm before leaving the page on the Aurelia.js

怎甘沉沦 提交于 2020-01-14 09:56:47
问题 I have an long operation on the page. How can I said user wait a bit when he make the navigation change? The idea is to show the promt dialog. But the trouble prevent default Aurelia router behavior. How make it works in Aurelia.js? 回答1: You could use the canDeactivate hook of your view-model. Like this: canDeactivate() { return confirm('Are you sure you want to leave this page?'); } canDeactivate() - Implement this hook if you want to control whether or not the router can navigate away from

Aurelia repeat.for does not refresh when model changes

本小妞迷上赌 提交于 2020-01-14 03:24:17
问题 I want to build a simple custom component with Aurelia that allows user to input one or more strings. When there are more than one items, list should show remove button for each item on the list. My problem is that the first item of the list does not show remove button when there are multiple items in the list. This is how it looks Here is the code and html I have for the custom list component: View <template> <div repeat.for="item of items"> <input type="text" value.bind="items[$index]">

How can I change which files Aurelia-App looks for?

人走茶凉 提交于 2020-01-12 18:34:06
问题 I've initialised aurelia with <body aurelia-app> ... </body> The getting started guide (http://aurelia.io/get-started.html) says that this will, by default, try to load up app.js and app.html How can I tell aurelia to load up main.js and main.html? if I do <body aurelia-app="main"> only main.js is accessed and the view isn't shown. 回答1: When you supply a value for the aurelia-app attribute, Aurelia will load that module and call the configure method that is exported by this module. This is

Aurelia select doesn't work

♀尐吖头ヾ 提交于 2020-01-11 12:29:09
问题 I have the following problem. I'm trying to fill a simple select by reading a json file and than displaying the title of any object as an option inside the select. The code works just fine when i try to display the titles inside div elements, but not as select. Here is my code: import {inject} from 'aurelia-framework'; import {HttpClient} from 'aurelia-http-client'; @inject(HttpClient) export class Select{ title = "Title"; images = []; url = 'http://api.flickr.com/services/feeds/photos_public