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

Documentation for Observing Collections shows Typescript language elements in EsNext View #420

Closed
Alfhir opened this issue Jun 28, 2019 · 1 comment

Comments

@Alfhir
Copy link

Alfhir commented Jun 28, 2019

I'm submitting a bug report
The documentation seems broken at this point . A user that does not know Typescript might not understand.

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Browser:
    Firefox 67.04 (64bit)

  • Language:
    ESNext

Current behavior:
Example for "Configuring a Collection Observer" in EsNext imports via autoinject and uses typescipt in constructor.

import {BindingEngine, autoinject} from 'aurelia-framework';
  
  @inject(BindingEngine)
  export class App {
  
    myCollection = ["foo"];
  
    constructor(private bindingEngine) {
      let subscription = this.bindingEngine.collectionObserver(this.myCollection)
        .subscribe(this.collectionChanged.bind(this));
    }
  
    collectionChanged(splices) {
        // This will fire any time the collection is modified. 
    }
  }

See

Expected/desired behavior:

import {BindingEngine} from 'aurelia-framework';

  @inject(BindingEngine)
  export class App {
    myCollection = ["foo"];
  
    constructor(bindingEngine) {
      this.bindingEngine = bindingEngine;
    }
  }
  • What is the motivation / use case for changing the behavior?
    Clean documentation
@EisenbergEffect
Copy link
Contributor

Looks like a copy/paste error on our part. I'll get a fix in shortly. Thank you and we apologize for the confusion!

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

No branches or pull requests

2 participants