Giter Club home page Giter Club logo

Comments (2)

fasttime avatar fasttime commented on May 18, 2024

I'm having a problem trying to reproduce this on my machine. The sample code doesn't compile because of a missing comma after selector: 'pim'. After fixing that, Angular complains about the unknown property formGroup in the inline template.

This is what I did: first I set up an Angular 9 project from the command line.

npm i -g @angular/cli
ng new test --interactive=false
cd test
npm i polytype
ng generate component pim --inline-template

Then I edited src/app/pim/pim.component.ts ending up with this code:

import { Component } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { classes } from 'polytype';

export class AbstractBaseComponent{
form: FormGroup
}


@Component ({
  selector: 'pim',
  template: `
 <form [formGroup] = 'form'>

  </form>
`

})
export class PimComponent extends classes(AbstractBaseComponent) {
// the form of the template is NOT referenced by the form of the AbstractBaseComponent as expected

}

When I run ng build, this is what I'm getting:

ERROR in src/app/pim/pim.component.ts:13:8 - error NG8002: Can't bind to 'formGroup' since it isn't a known property of 'form'.

13  <form [formGroup] = 'form'>
          ~~~~~~~~~~~~~~~~~~~~

This is obviously not related to Polytype.
And in fact, replacing classes(AbstractBaseComponent) with AbstractBaseComponent doesn't make a difference.

It would be helpful if you could post a reproducible example, so I can check why the code in your first snippet is not producing the same error I'm getting here in the first place.

from polytype.

fasttime avatar fasttime commented on May 18, 2024

Closing as not reproducible. Feel free to open a new issue if you think the problem still needs to be investigated.

from polytype.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.