aurelia / documentation

The documentation for Aurelia.
MIT License
105 stars 111 forks source link

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

Closed Alfhir closed 5 years ago

Alfhir commented 5 years ago

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:

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;
    }
  }
EisenbergEffect commented 5 years ago

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