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

Dependency Injection #25

Closed
doktordirk opened this issue Jul 20, 2016 · 7 comments
Closed

Dependency Injection #25

doktordirk opened this issue Jul 20, 2016 · 7 comments
Labels

Comments

@doktordirk
Copy link
Contributor

Following works in the app, but with aurelia-testing the element does not get created. There is no error message.

import {bindable, BindingEngine} from 'aurelia-framework';
import {inject} from 'aurelia-dependency-injection';

@inject(BindingEngine)
    export class MyComponent {
      @bindable firstName;

      constructor(bindingEngine,) {
      this.bindingEngine  = bindingEngine;
    }

maybe related:
function 'processor' does not get called in aurelia-testing:

import {processContent} from 'aurelia-templating';

function processor(compiler, resources, node, instruction){
  console.log(compiler, resources, node, instruction);
  return true;
}

@processContent(processor)
export class MyAttributeCustomAttribute {
  static inject = [Element];
      constructor(element) {
        this.element = element;
      }

      valueChanged(newValue){
        this.element.style.backgroundColor = newValue;
      }
    }
@EisenbergEffect
Copy link
Contributor

@martingust Can you take a look?

@martingust
Copy link
Contributor

@EisenbergEffect I'm on vacation for another week or so without access to computer. If no one else have looked into this before I get back I will.

@doktordirk
Copy link
Contributor Author

might be the reason aurelia/framework#480

@tkhyn
Copy link
Contributor

tkhyn commented Jul 22, 2016

@doktordirk you may want to try and add a timeout. The quickest way is to replace the 0 at the end of this line by a reasonably high number of milliseconds. Of course you'll have to replace it in the transpiled code, in the jspm package folder for aurelia-testing.

If it works with a timeout, then it's likely to be related.

@doktordirk
Copy link
Contributor Author

re timeout: i played with it, but to no avail. but considering i get component.dispose undefined or something, it still seem related (since it'll get defined within some promise and no-one waited for it to resolve apparently)

@doktordirk
Copy link
Contributor Author

any news?

@doktordirk
Copy link
Contributor Author

hmm, samples i gave above work fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants