question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tried to bind to a property that is not marked as @Input: vm from base class

See original GitHub issue

I have an abstract base class that includes an @input property, when I extend that base class I use that input in many places in the extended class.

The issue I’m having is that, when testing it on binding that property I get the following error: Error: Tried to bind to a property that is not marked as @Input: vm

Here’s an example on what would be the scenario:

export abstract class BaseClass{
   @Input() public vm: MyProperty;
}

export class MyComponent extends BaseClass{
  //code here
}

now, if I try to initialise my test in the following way:

beforeEach(async () => {
  shallow = new Shallow(MyComponent, MyModule);
  const { instance } = await shallow.declare().render({ bind: { vm: myMockValue } });
});

this will break when I run it as it won’t identify the vm property as an input, which is, but it’s declared in the base class, not in the child class (the one I’m testing).

Is this a bug or am I supposed to test in a different way when the @input is declared in the base class?

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
getsafcommented, Dec 23, 2022

@antch I just backported this to 13.0.2!

1reaction
getsafcommented, Aug 8, 2022

Sorry about that, was unintentional. I can try looking into this later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular 4 Can't bind to <property> since it isn't a known ...
But, I got this error when bind the property of class into component template. Console error: Unhandled Promise rejection: Template parse errors: Can't...
Read more >
Solved: New-VM - Not accepting a variable as input
The object type of $strBestHost is wrong. This is caused by Select, as it creates a new object and copies the properties you...
Read more >
A Better Way to Implement Data Binding in .NET
One way to simplify the situation is with a base class, in order to reuse some of the boilerplate logic. This also provides...
Read more >
Binding to a property which is not in baseclass in UI for WPF
This is true, the DbBaseObject doesn't have a property "Name" but this shouldn't be a reason not to show a column. Is there...
Read more >
Throwable
AndroidException, Base class for all checked exceptions thrown by the ... thrown when an attempt is made to connect a SocketChannel for which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found