teambit / envs

Component development environments for the Bit community
https://bit.dev/bit/envs
Other
63 stars 9 forks source link

[BUG] Angular env - component with @Input #153

Closed lifaon74 closed 3 years ago

lifaon74 commented 3 years ago

Describe the bug

I have exported a component, on bit dev, based on Angular 9, which includes an @Input (which is extremely common for Angular). The components builds and works properly locally, but doesn't load correctly on https://bit.dev/[org name]/[collection]/[name]

Steps to Reproduce

import { Component, Input } from '@angular/core';

@Component({
  selector: 'my-component',
  template: '{{ content }}',
  styles: []
})
export class MyComponent {
  @Input() content = '';

  constructor() {
  }
}

app.component.html:

<my-component [content]="'hello world'"></my-component>

On the playground it generates:

Uncaught Error: Template parse errors:
Can't bind to 'content' since it isn't a known property of 'my-component'.

Of course, it includes a .module.ts

Usually this bug comes from incorrect import/export of metadata (Angular's decorator metadata)

Specifications

Aditional

It may be useful to express a little more functionalities of Angular on the bit-angular-tutorial: https://github.com/teambit/bit-angular-tutorial/blob/master/src/app/product-list/product-list.component.ts like: @Input, @Output, @Directive, @Service, if you're running tests on it

JoshK2 commented 3 years ago

Hi, I close this issue, I merged and exported a new version with your fixes: https://github.com/teambit/envs/pull/154 Thanks for your fixes.