aurelia

Observe property on an array of objects for any changes

≡放荡痞女 提交于 2019-11-30 00:26:08
I am using Aurelia and I have an array of items bound to a grid and they have a selected property on them. I want to bind a button to be enabled when any one of the items is true. I can do a brute force approach where I have a getter that is filtering the list and returning the selected items, but that means that I would be doing dirty checking constantly in the app and I don't want to do that. I am hoping for a more efficient approach. Any ideas? Few things you could do- assuming I have your use case right: dirty-checking (it's only one property- not a big deal) export class Item { selected =

Assisted injection in Aurelia?

孤街醉人 提交于 2019-11-29 23:16:03
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 automatically inject the dependency but allow the class's consumer to specify the config value? Here are some options: Option 0: Factory Resolver foo.js import {inject} from 'aurelia-framework'; import {FooDependency} from './foo-dependency'; @inject(FooDependency) export class Foo { constructor(dep, config) { } } needs-foo.js import {inject, Factory} from

Assisted injection in Aurelia?

╄→гoц情女王★ 提交于 2019-11-29 23:14:15
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 automatically inject the dependency but allow the class's consumer to specify the config value? Here are some options: Option 0: Factory Resolver foo.js import {inject} from 'aurelia-framework'; import {FooDependency} from './foo-dependency'; @inject(FooDependency) export class Foo { constructor(dep, config) { } } needs-foo.js import {inject, Factory} from

Posting data and file with Aurelia to ASP.NET webapi

ε祈祈猫儿з 提交于 2019-11-29 22:55:30
问题 I'm trying to add an input with file upload to my application. This is my view with two inputs, one text and one file: <template> <form class="form-horizontal" submit.delegate="doImport()"> <div class="form-group"> <label for="inputLangName" class="col-sm-2 control-label">Language key</label> <div class="col-sm-10"> <input type="text" value.bind="languageKey" class="form-control" id="inputLangName" placeholder="Language key"> </div> </div> <div class="form-group"> <label for="inputFile" class

How to pass data from ASP.NET WebForms to Aurelia Global Scope

不羁岁月 提交于 2019-11-29 21:09:19
问题 I am bootstrapping Aurelia from a Web-forms based legacy application. My authentication related information is maintained in the web-forms application in the Custom Base Page class. How do I pass & maintain this authentication information to Aurelia's global scope? So that I can use it while building the menus using routes to show/hide certain menu items based on the user/role? 回答1: You could put logic your custom base page to add a <script> tag to the head of the document that makes all the

Multiple Aurelia apps on one page

倾然丶 夕夏残阳落幕 提交于 2019-11-29 15:27:56
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. Yep, just add two elements to the page with an aurelia-app attribute. Here's an example: https://gist.run?id=2d310abbbea337fb5f6d110ec807f7d2 <!doctype

How can I configure two or more apps in Aurelia using Webpack

为君一笑 提交于 2019-11-29 15:19:11
I'm trying to wrap my head around the starter kit skeleton-esnext-webpack and the way the Aurelia team has set up the webpack.config.babel.js Now that I have somehow understood how to configure a basic project in Aurelia, before I go any further, what I want to know is whether it is possible to configure more than one app ( aurelia-app ) using Webpack and how? The "Quick Start" guide gave the impression that it is possible by creating more than one js file, each of which should export a configure method specifying the root component ( setRoot ). This seemed sort of easy in the "Quick Start"

Aurelia trying to load HTML from Select2?

青春壹個敷衍的年華 提交于 2019-11-29 15:07:27
So I'm trying to use Select2 within my Aurelia application. I installed Select2 using jspm install select2 , and within my app.html file I require Select2 using <require from="select2/js/select2.min.js"></require> . The browser loads the minified JS file fine, but for some reason it also tries to load http://localhost:3003/jspm_packages/github/select2/select2@4.0.0/js/select2.min .html . Why is Aurelia trying to load the HTML counterpart of the same JS file that I specified in my <require> element? How can I fix this? Thanks The purpose of <require from="...."></require> is to import a view

How to use JQuery UI components in Aurelia getting started app (navigation app)

烂漫一生 提交于 2019-11-29 14:40:52
问题 I am able to run the Aurelia app by following the steps provided in getting started tutorial. They have used bootstrap nav-bar in the skeleton application. Is it possible to use JQuery UI components in the Aurelia app. If yes, please explain me how to achieve this. Thanks in advance. 回答1: Yes, it's possible! I've made a jQueryUI Tabs example for you: tabs.html <template> <ul> <li repeat.for="tab of tabs"> <a href="${'#' + $parent.id + '-' + $index}">${tab.title}</a> </li> </ul> <div repeat

Configure IIS server to work with Aurelia framework and push state

无人久伴 提交于 2019-11-29 13:17:36
I have created a basic aurelia app starting from this repo and I was trying to get rid of the # (hashtag) in the URL bar. I have 2 projects, one running WebApi on a machine and one running an empty web project (not MVC) on another machine. On the official documentation website it only says how to configure your routes but my project is not MVC oriented. How can I configure the IIS server from Web.config in a sense that when I access http://localhost/home it should start the aurelia framework rather than the 404 not found page? Matt McCabe I'm using the Azure which needed a web.config to handle