aurelia

Would it be possible to use JQuery Bootstrap framework along with Aurelia?

混江龙づ霸主 提交于 2019-12-13 20:04:49
问题 Would it be possible to use jQuery Bootstrap with Aurelia? There are some toggle buttons and other components I would like to use that come with Bootstrap. So far, all of the examples I have seen are using jQuery UI along with Aurelia. 回答1: Take a look at the skeleton-navigation project. It uses bootstrap by default: https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-es2016 The magic happens here https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-es2016/src

NPM update error - Fails to execute GIT

a 夏天 提交于 2019-12-13 17:42:02
问题 When I try to create a project I get the error below. It seems to be network related because it occurs only in company network. Any idea how to troubleshoot that? D:\Projects\aurelia>au new test3 . . . Installing project dependencies. npm ERR! git clone --template=C:\Users\user\AppData\Roaming\npm-cache_git-r emotes_templates --mirror git://github.com/gulpjs/gulp.git C:\Users\AppData\Roaming\npm-cache_git-remotes\git-github-com-gulpjs-gulp-git-4-0ecf98f08 : npm ERR! git clone --template=C:

Error: container has not been made global - how to solve?

末鹿安然 提交于 2019-12-13 17:24:38
问题 I'm trying to get the Firebase Reactive Collection (Sync database) to work with the Aurelia-Firebase plugin. I'm using the following code to set a reference to the database: // collections/table.js import {inject} from 'aurelia-framework'; import {ReactiveCollection} from 'aurelia-firebase'; export class TableCollection extends ReactiveCollection { constructor() { super('tables'); } } And the following code to see if the reference is working: // table-overview.js import {inject} from 'aurelia

CORS errors on Azure Translator API (Cognitive Services) when using Aurelia's Fetch Client

大兔子大兔子 提交于 2019-12-13 16:23:03
问题 I try to use a very basic API call from Windows Azure to translate some texts. They gives a quickstart example code. I try this code and it works pretty well. The text Hello world is translated into deutch and italian. I removed my personal subscription key. Here is the sample: const request = require('request'); const uuidv4 = require('uuid/v4'); const subscriptionKey = '........'; let options = { method: 'POST', baseUrl: 'https://api.cognitive.microsofttranslator.com/', url: 'translate', qs

Adding a module dependency in Aurelia with Webpack

落爺英雄遲暮 提交于 2019-12-13 16:18:43
问题 I'm just getting started with the Aurelia Webpack Skeleton and trying to simply add a new dependency. Suppose I want to use moment.js in my application. What are the expected steps to download and use the module in my application? EDIT: I see that moment.js is already loaded by default. So suppose it's numeral.js I want to use as an example. 回答1: Install the library via npm using a console, pointing to the application folder: npm install numeral --save Now, you just have to import it in your

Aurelia - Error with click.delegate - saying the function is not a function

青春壹個敷衍的年華 提交于 2019-12-13 16:01:16
问题 Novice. I have a viewmodel that has a function that simply toggles a value: import { autoinject } from "aurelia-framework"; import { bindable } from "aurelia-templating"; import { LoggedInService } from "../components/auth/LoggedInService"; @autoinject export class Navmenu { constructor(public loggedInService: LoggedInService) { this.loggedInService = loggedInService; } toggleloggedInTest() { // just for testing this.loggedInService.isLoggedIn = !this.loggedInService.isLoggedIn; } } In it

Aurelia validation: applying some rule on change and some on blur on same property

天涯浪子 提交于 2019-12-13 15:57:31
问题 I have an input field for a value that should have exactly 5 digits. I would like to show errors when typing characters other than digits immediatly (onChange) but showing the error for unsufficient string length only on blur. My rule looks like so at the moment: ValidationRules .ensure("myInput") .matches(new RegExp(/[0-9]/)) .minLength(5) .on(this); MaxLength is restricted by setting maxlength in html. If I set the validation trigger to "onChange" to get an immediate response to wrong

Use Validation on class object without injection in Aurelia

末鹿安然 提交于 2019-12-13 15:24:45
问题 I am facing one issue related to the injection(s) in Aurelia. I was wondering how to implement Validation, EventAggregator and Router without injection. Below you can find an example which may give you a clear picture about the implementation and where I am stuck. class Profile interacts with the view, and object of AddressList is created in the profile class and this object(AddressList) interacts with the view. For example: @inject(EventAggregator, Validation, Router) export class Profile{

Aurelia + Php Possible/Recommended?

血红的双手。 提交于 2019-12-13 14:44:24
问题 Before this question gets closed, I know the setup above is possible. I just want clarification on some things. I just started learning Aurelia because I want to convert one of my projects into a web app. My project is built with html+css+JavaScript(jQuery)+ PHP(MySql). I havent used any sort of framework before. In the guide, they mention a few ways to setup a web server. I used the http server with node. Now this is where I need some help understanding a few things. I dont want to use node

How to “inherit” bindable properties in Aurelia?

孤街醉人 提交于 2019-12-13 13:42:16
问题 I am developing an Aurelia application using TypeScript. In this application I defined a set of custom elements each sharing a set of bindable properties that get translated to css settings as shown in the following simplified example: import {computedFrom, bindable, autoinject} from 'aurelia-framework'; @autoinject export class MyCustomElement { @bindable span: number; @computedFrom('span') get width() { return this.span? this.span* 26 : 0; } // Leaving out a whole bunch of other code for