by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 12 14:58
    elimt commented #905
  • Aug 12 08:48
    PetrMotlicek commented #473
  • Aug 11 07:39
    rmja opened #168
  • Aug 08 06:47
    radenkozec closed #663
  • Aug 08 06:47
    radenkozec commented #663
  • Aug 07 20:00
    radenkozec edited #663
  • Aug 07 20:00
    radenkozec edited #663
  • Aug 07 19:58
    radenkozec commented #663
  • Aug 07 19:57
    radenkozec reopened #663
  • Aug 07 10:51
    radenkozec closed #663
  • Aug 07 10:51
    radenkozec commented #663
  • Aug 05 09:03
    radenkozec opened #663
  • Aug 05 07:09
    JSeligsohn commented #343
  • Aug 01 11:41
    CLAassistant commented #687
  • Aug 01 11:41
    dependabot[bot] labeled #687
  • Aug 01 11:41
    dependabot[bot] opened #687
  • Aug 01 11:41

    dependabot[bot] on npm_and_yarn

    chore(deps): bump elliptic from… (compare)

  • Aug 01 04:48
    CLAassistant commented #320
  • Aug 01 04:48
    dependabot[bot] labeled #320
  • Aug 01 04:48
    dependabot[bot] opened #320
bigopon
@bigopon
@pmanu93 by default, Aurelia invokes preventDefault on all listener if the event handler does not return true. So in the click handler of li element, you just need to return true
Luis Lebolo
@lebolo
@bigopon: thanks!
NightWulfe
@NightWulfe

Hello. I used the information in the manual for setting up a simple aurelia with webpack, without using aurelia-cli. When I run npx webpack to build the project, I get this error:

ERROR in multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-boostrapper Module not found: Error: Can't resolve 'aurelia-webpack-plugin/runtime/empty-entry' in '' @ multi-aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-load-entry aurelia-bootstrapper main[0]1
I've tried installing aurelia-pal-browser and aurelia-pal-nodejs with no change. Any ideas?

Jameson Strocsher
@jamesond
@rafatpc Did you happen to figure out your issues with a rest parameter must be of an array type for aurelia-dependency-injection?
NightWulfe
@NightWulfe
No one can offer any ideas as to what may be causing my error?
Pedro Silva
@pmanu93
@bigopon :Thanks!
Luis Lebolo
@lebolo

Is there a limit to the number of global resources I can register? I have a resources/index.ts that looks like

import {FrameworkConfiguration, PLATFORM} from 'aurelia-framework';

export function configure(config: FrameworkConfiguration) {
  config.globalResources([
    PLATFORM.moduleName('./elements/resource-1/resource-1'),
    PLATFORM.moduleName('./elements/resource-2/resource-2'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/resource-3'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-4/resource-4'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-5/resource-5'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-6/resource-6'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-7/resource-7'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-8/resource-8'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-9/resource-9'),
    PLATFORM.moduleName('./elements/resource-2/resource-3/inputs/resource-10/resource-10'),
  ]);
}

But when I inject ViewResources into my app.ts constructor and print it out, I get

elements:
  compose: HtmlBehaviorResource {elementName: "compose", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}
  resource-2: HtmlBehaviorResource {elementName: "resource-2", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}
  resource-1: HtmlBehaviorResource {elementName: "resource-1", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}
  resource-4: HtmlBehaviorResource {elementName: "resource-4", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}
  resource-3: HtmlBehaviorResource {elementName: "resource-3", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}
  router-view: HtmlBehaviorResource {elementName: "router-view", attributeName: null, attributeDefaultBindingMode: undefined, liftsContent: false, targetShadowDOM: false, …}

I confirmed that they all exist and can be found. Weirdly, if I comment out the resource-4 line in index.ts then ViewResources will just show resources 1, 2, 3 & 5 instead. Is there a limit?

NightWulfe
@NightWulfe
Yesterday I had a problem where webpack was reporting an error about being unable to resolve empty-entry when doing npx webpack. Either no one was willing to help, or they just didn't know the issue. I finally figured it out, so I'll post it here in the off chance anyone else runs into the problem: Make sure there are periods prefixed to the resolve extensions in your webpack config.
TonyLugg
@TonyLugg
Using Aurelia Dialog 2.0.0, the ux-dialog has fit-content for height and width, which works well in Chrome and Firefox but Edge does not like it. Is there a fix?
bigopon
@bigopon
@lebolo there shouldn't be a limit, maybe there's something wrong inside those registration?
@NightWulfe we are trying to migrate the community over discord https://discord.gg/MfzdX9s, and discourse https://discourse.aurelia.io/
Please post your Q there for faster response. For your particular error, I remember seeing them but I'm not sure how to resolve it
Alfred Lopez
@alfredlopez

Quick question…

if I have something like

@connectTo<State>( {
     selector: {
           myStateVar: ….
     }
})

Do I still have to create the property myStateVar? I’ve been applying the @ts-ignore everywhere I have this.myStateVar.

bigopon
@bigopon
@alfredlopez you don't have to. But it doesn't really hurt to declare it for the purpose of documentation and readability/maintainability
a simple comment where its value comes from should be awesome for the next time someone reads it
Corneliu
@corneliutusnea

Guys, is there an event in my MV where I know for sure that the child view-models are already created? E.g. I have this view:

<template>
<child view-model.ref="childView"></child>
</template>

Now I find myself in the parent view in various events (e.g. bind, activated or attached) in which the this.childView is always null. If I set a timeout and check at some point in the future I can see it's created and available but I can't find any predictability to when that will be available. Thoughts?

Keith Davidson
@davidsk
Hi all. Would I be correct in thinking that there's no way to bind to an array element by index? Something like:
//viewModel
class myClass{
   myArray: ['A','B','C']
}

// view
<template>
   <input value.bind="myArray[1]" />
   ${myArray[1]}
</template>
Alfred Lopez
@alfredlopez
Thanks @bigopon
bigopon
@bigopon
@kensign not in v1, as Aurelia in v1 doesnt observe index. Though it can be made to work. Maybe create a topic on discourse or a feature request on github?
Keith Davidson
@davidsk
@bigopon I assume you're referencing my question about arrays and indexing. I did eventually find some info on using the mutator methods to manipulate the array which seems to work okay. This doesn't seem to be documented in the docs though :'(
bigopon
@bigopon
Yeah, we have some minor hiccups like this in the doc
Well I should learn to incorporate complains into doc
@corneliutusnea if you declared childView as @observable, then you can react to childView readiness in childViewChanged?
Khuzema Kanore
@khuzemakanore

Hello guys, I have below statement (using typescript)

      getAllUsers(): UserProfile {
      return this._httpClient.fetch(Constants.apiRoot + 'Account/Users');
    }

The above statement is giving error. How should I construct the above statement so its satisfy the typescript requirement for typecasting the UserProfile as a return result. Thanks

bigopon
@bigopon
@khuzemakanore you can do:
getAllUsers(): UserProfile {
  return this._httpClient.fetch(Constants.apiRoot + 'Account/Users').then(r => r.json());
}
rhys
@rhysshadow

i am trying to run a new app i'm working on, and i've got the following error:

aurelia-logging-console.js?dc89:45 ERROR [app-router] Error: Route not found: /
at AppRouter.Router._createNavigationInstruction (aurelia-router.js?e32b:957)
at AppRouter.loadUrl (aurelia-router.js?e32b:2020)
at BrowserHistory._loadUrl (aurelia-history-browser.js?d627:262)
at BrowserHistory.activate (aurelia-history-browser.js?d627:156)
at AppRouter.activate (aurelia-router.js?e32b:2091)
at AppRouter.registerViewPort (aurelia-router.js?e32b:2068)
at new RouterView (aurelia-templating-router.js?ab30:59)
at Object.invoke (aurelia-dependency-injection.js?dd4f:384)
at InvocationHandler.invoke (aurelia-dependency-injection.js?dd4f:357)
at Container.invoke (aurelia-dependency-injection.js?dd4f:543)
error @ aurelia-logging-console.js?dc89:45
eval @ aurelia-logging.js?30fd:38
eval @ aurelia-router.js?e32b:2023
Promise.catch (async)
AppRouter.loadUrl @ aurelia-router.js?e32b:2022
BrowserHistory._loadUrl @ aurelia-history-browser.js?d627:262
BrowserHistory.activate @ aurelia-history-browser.js?d627:156
AppRouter.activate @ aurelia-router.js?e32b:2091
AppRouter.registerViewPort @ aurelia-router.js?e32b:2068
RouterView @ aurelia-templating-router.js?ab30:59
invoke @ aurelia-dependency-injection.js?dd4f:384
InvocationHandler.invoke @ aurelia-dependency-injection.js?dd4f:357
Container.invoke @ aurelia-dependency-injection.js?dd4f:543
get @ aurelia-templating.js?8628:2281
Container.get @ aurelia-dependency-injection.js?dd4f:498
elementContainerGet @ aurelia-templating.js?8628:2336
create @ aurelia-templating.js?8628:4362
applyInstructions @ aurelia-templating.js?8628:2446
create @ aurelia-templating.js?8628:2667
create @ aurelia-templating.js?8628:4374
eval @ aurelia-templating.js?8628:4870
Promise.then (async)
createController @ aurelia-templating.js?8628:4869
_createControllerAndSwap @ aurelia-templating.js?8628:4828
compose @ aurelia-templating.js?8628:4930
compose @ aurelia-templating.js?8628:5196
setRoot @ aurelia-framework.js?0682:113
eval @ main.js?56d7:66
Promise.then (async)
configure @ main.js?56d7:55
eval @ aurelia-bootstrapper.js?6fd9:128
Promise.then (async)
config @ aurelia-bootstrapper.js?6fd9:123
eval @ aurelia-bootstrapper.js?6fd9:159
Promise.then (async)
bootstrap @ aurelia-bootstrapper.js?6fd9:158
eval @ aurelia-bootstrapper.js?6fd9:145
Promise.then (async)
run @ aurelia-bootstrapper.js?6fd9:140
eval @ aurelia-bootstrapper.js?6fd9:165
eval @ b9nV:143
b9nV @ vendors~0ba1d959.2232acfea14b69620719.chunk.js:23
webpack_require @ runtime~app.2232acfea14b69620719.bundle.js:80
0 @ app~f075b844.2232acfea14b69620719.chunk.js:13
webpack_require @ runtime~app.2232acfea14b69620719.bundle.js:80
checkDeferredModules @ runtime~app.2232acfea14b69620719.bundle.js:46
webpackJsonpCallback @ runtime~app.2232acfea14b69620719.bundle.js:33
(anonymous) @ app~f075b844.2232acfea14b69620719.chunk.js:1
aurelia-logging-console.js?dc89:45 ERROR [app-router] Router navigation failed, and no previous location or fallbackRoute could be restored.

code from app.js

import {PLATFORM} from 'aurelia-framework';

export class App {
  configureRouter( config, router )
  {
    config.title = 'ARIS';
    config.options.pushState = true;
    config.options.root = '/';

    config.map([
      {route: '', moduleId: PLATFORM.moduleName('home'), nav: true, title: 'home'},
      {route: 'search', moduleId: PLATFORM.moduleName('search'), nav: true, 
        title: 'Search/Worklist'},
    ]);

    config.fallbackRoute('/');

    this.router = router;
  }
}
WisdomCorp
@WisdomCorp
Hello, what is the Aurelia generator command for creating simple html and ts file? like for element you have
au generate element newelement
bigopon
@bigopon
@rhysshadow the API is config.mapUnknownRoutes instead of fallbackRoute
for your Q, the string you pass to mapUnknownRoutes is the path to the view model you want to use, not a redirect URL
@WisdomCorp you meant create a pair, but not for an element?
WisdomCorp
@WisdomCorp
yes
It will be similiar as element but generate in current directory with basic structure for html ie: <template> ${Your template} </template>) and for ts file ie: export class className { }. Hope I am clear :)
bigopon
@bigopon
well ... maybe put a request in our cli repo? That feature is not there, afaik :smile:
probably everyone was fine with doing it manually
WisdomCorp
@WisdomCorp
Not an issue. Just think of it when there are all other generators available this one should be the first to be there ;)
thanks
bigopon
@bigopon
no worries :smile:
and, if you can, have fun here https://discourse.aurelia.io and here https://discord.gg/RBtyM6u
we are trying to migrate our community there
discourse for Q/A topics & discord for quick chat
WisdomCorp
@WisdomCorp
what is the error object return by aurelia-fetch-client. I will use discord
bigopon
@bigopon
for fetch client, you get a response, and it could depends on what you do with it (rethrow a normalized error object), you get a different thing
WisdomCorp
@WisdomCorp
I mean you get something similar
import { HttpErrorResponse } from "@angular/common/http";
bigopon
@bigopon
@WisdomCorp not out of the box. Thought you can easily do similar thing with our interceptor. Simply intercept response error and process it the way you like
WisdomCorp
@WisdomCorp
Any pointer to code sample or doc
scroll down a bit to the with interceptors section
WisdomCorp
@WisdomCorp
Thanks
bigopon
@bigopon
no worries :smile:
night