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

Support for as syntax in template #289

Closed
johnrbaur opened this issue Apr 7, 2017 · 2 comments
Closed

Support for as syntax in template #289

johnrbaur opened this issue Apr 7, 2017 · 2 comments
Assignees
Labels

Comments

@johnrbaur
Copy link

This line:
<ng-container *ngIf="employee$ | async as emp">

currently produces this error:
The property "emp" that you're trying to access does not exist in the class declaration.

The feature was added to Angular in this PR: angular/angular#15025

@mgechev
Copy link
Owner

mgechev commented Apr 7, 2017

Thanks for reporting this out! I'll work on it in the next week or two.

@mgechev mgechev self-assigned this Apr 20, 2017
@mgechev mgechev added this to the 3.0.0 - Lamido milestone Apr 20, 2017
@mgechev
Copy link
Owner

mgechev commented Apr 22, 2017

Did you check if you're getting any mismatched peerDependencies? For me the new syntax works.

Here's a test which codelyzer passes:

it('should work with "as" syntax', () => {
  let source = `
    @Component({
      template: \`
        <ng-container *ngIf="employee$ | async as emp">{{ emp }}</ng-container>
        \`
    })
    class Test {
      employee$;
    }`;
    assertSuccess('no-access-missing-member', source);
});

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

2 participants