Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow import of exported module items into aurelia template, to allow access to static methods, static variables, enums, type definitions, etc. #743

TheNavigateur opened this issue Mar 22, 2017 · 3 comments


None yet
3 participants
Copy link

commented Mar 22, 2017

I'm submitting a feature request

Something like

equivalent of

import {App, SomeEnum} from "../app";

<require def="App, SomeEnum" from="../app"/>



  • What is the motivation / use case for changing the behavior?

Aurelia seems incomplete unless this is provided.


This comment has been minimized.

Copy link

commented Mar 23, 2017

It can be done already, though not automatically. You would use view engine hooks to declare what should be attached to the override binding context. Then when you imported that module it would make available the items you wanted.


This comment has been minimized.

Copy link

commented Mar 23, 2017

Here's an example:


import {viewEngineHooks} from 'aurelia-templating';

let countries = [
  { abbreviation: "AF", name: "Afghanistan" },
  { abbreviation: "AL", name: "Albania" },
  { abbreviation: "DZ", name: "Algeria" },

export class CountryBinder {
  beforeBind(view) {
    view.overrideContext.countries = countries;


<template class="user-detail" bindable="controller"> 
  <require from="resources/data/countries"></require>

  <select class="form-control">
    <option value="" selected="selected">(please select a country)</option>
    <option repeat.for="country of countries" value.bind="country.abbreviation">${}</option>

This comment has been minimized.

Copy link

commented Mar 19, 2018

async triageQuestion(id) =>{
 let response = await getResponseFromOP( { timeout : Year} )
 if(!response) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.