aurelia

Force show.bind execution

吃可爱长大的小学妹 提交于 2019-12-12 17:32:27
问题 I have a table with data, and i want view to check show.bind statement when the event is fired from another view. The problem is that the event is not changing any data in the current view. foo.html: <tr repeat.for="entity of viewData.entities"> ... <p if.bind="$parent.canBeRemoved(entity.id)"> canBeRemoved </p> ... </tr> I'm receiving the event with EventAggregator and i want it to force refresh on the array. Is it possible? 回答1: Use the signal binding behavior The best way to handle this is

Aurelia JS - iterate through children (kendo UI) elements?

断了今生、忘了曾经 提交于 2019-12-12 17:27:35
问题 Consider the basic example given here: https://aurelia-ui-toolkits.github.io/demo-kendo/#/samples/slider-basic-use ... which is also available on gist.run: https://gist.run/?id=387c43948dc83acf59ea3497472bdfe9 In that app.html , there are several sliders constructed as input of class="eqSlider" , like this: <input repeat.for="value of equalizerSliderValues" ak-slider="k-orientation: vertical; k-min.bind: -20; k-max.bind: 20; k-value.bind: value; k-small-step.bind: 1; k-large-step.bind: 20; k

I'm doing Promises wrong… What am I missing here?

半腔热情 提交于 2019-12-12 17:24:45
问题 I have a file token.ts that exports 1 function: import * as jwt from 'jsonwebtoken'; import { db, dbUserLevel } from '../util/db'; export function genToken(username, password): Object { let token: Object; let token_payload = { user: username, admin: false }; let token_payload_admin = { user: username, admin: true }; // TODO: Add secret as an environment variable and retrieve it from there let token_secret = 'move this secret somewhere else'; let token_header = { issuer: 'SomeIssuer',

Aurelia change state twice in one action

孤街浪徒 提交于 2019-12-12 12:24:17
问题 I am developing with aurelia and using aurelia-store for app state management. On loading data from server, I want to change an isLoading field true/false to show mask on related components. So I have defined a property in my state isLoading (for example). In the loading action I want first change the loading state to true and after data retrieved to false. So that according to the value of this field (isLoading) I want to display the mask over component. I want something like this: export

aurelia - example, error installing dependencies

喜欢而已 提交于 2019-12-12 12:22:58
问题 I've been following the examples on the Aurelia site and with this one: http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/contact-manager-tutorial/2 I run 'au new' and follow through the prompts and it gets to the "Would you like to install the project dependencies" question, and I say Yes and it then fails with the below errors. Does anyone have an idea on why? I have Node.JS and a GIT client installed. Would you like to install the project dependencies? 1. Yes (Default)

Aurelia Validation Rules: Unable to parse accessor function

穿精又带淫゛_ 提交于 2019-12-12 10:45:15
问题 It seems there have been various problems elsewhere in regards to the aurelia-validation module, but I haven't seen anything that has addressed the specific problem I've been running into. I have a model class with the definition and validation rules as below: my-model.js my-model = { "name": { "full": "", "short": "", } }; ... ValidationRules .ensure(model => model.name.full).required().minLength(5).maxLength(50) .on(this.my-model); When I try it in the browser, however, I get the error: ...

Aurelia - Switching between app roots with different route configurations

痴心易碎 提交于 2019-12-12 10:37:35
问题 UPDATE Could this issue have something to do with mu problem? https://github.com/aurelia/framework/issues/400 I have an Aurelia application with two different roots, one for loggen in users, and another for anonymous users. I have in other Aurelia apps implemented a chanaging of app root based on the approach in this answer. This works very well when the login module is an "isolated" module with no additional routes, but I'm having a hard time getting it to work now. index.js - root for

How can toastr.js work in Aurelia and Typescript?

无人久伴 提交于 2019-12-12 09:38:20
问题 I can't seem to get these to work together. I'm using the Aurelia CLI and have done so in a similar manner for other libraries successfully(like select2, spin, moment and numeral). I can't seem to get toastr to work though. Here is what I have so far. First I ran npm install toastr --save and typings install dt~toastr --global --save In aurelia.json , in the vendor-bundle.js section, I added a dependency as such: "jquery", { "name": "toastr", "path": "../node_modules/toastr/build", "main":

Script tag in Aurelia view is not executed

痴心易碎 提交于 2019-12-12 09:36:05
问题 I'm adding a simple script block to a simple aurelia view: <template> <script type="text/javascript"> alert('Hello!'); </script> </template> The script is never run, even though the view is rendered correctly and I can see that the script block does appear in the DOM. I have also tried dynamically inserting a script block via the viewModel and also tried with: <script type="text/javascript" src="http://blah"></script> I understand it's not best practice to do this, but I'm trying to integrate

Global Functions In Aurelia

倾然丶 夕夏残阳落幕 提交于 2019-12-12 09:34:34
问题 I'm trying to figure out how to store a "global" like function in Aurelia. I've followed this tutorial "http://blog.durandal.io/2015/04/24/aurelia-custom-elements-and-content-selectors/" to open a modal with a dynamic view modal, but I can't figure out where I should actually put this function so I can re-use it all my view routes. I've created this function in my default view: //open modal setModal(modal) { this.contentModal = modal; $('.modal').modal(); } with this markup inside that view