facebook

Template does not validate until full build or template source edit

  1. CodeMix & Angular IDE
  2.  > 
  3. Webclipse 1.x Help
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #545259 Reply

    Fedor Losev
    Participant

    Example:

    If we have input x on a component and <component [x]=1> in another, and remove x from the component class, no warning ‘Cant bind to target` appears until full rebuild or template edit/save.

    As a subcase, to get autocomplete on new fields one needs to re-save template to trigger re-validation.

    #545362 Reply

    support-swapna
    Moderator

    Fedor,

    Sorry that you are seeing this issue. I could not replicate the problems at my end.
    I have added the @Input() x: number; to the app.component.ts file and referenced it in the app.component.html file as below :

    <app-root [x]=1>
    </app-root>

    When I remove the x or delete the entire @Input() line from the app.component.ts file and save it, I see the x in the app.component.html being validated and marked with Can't bind to 'x' since it isn't a known property of 'app-root'. I didn’t have to trigger a save or edit/save the app.component.html to get the validation right.

    Regarding autocomplete for new field, I added a new array or a variable to the app.component.ts file and saved it. Once done, I invoked content assist in the *ngFor and I do see the newly added fields listed.

    If you are following different steps, then please share with us the details along with code snippets to help us replicate the problem at our end.

    –Swapna
    MyEclipse Support

    #545383 Reply

    Fedor Losev
    Participant

    Hi, I already mentioned different steps, you need two components to reproduce, what doesn’t re-validate for me is the template of parent component (that didn’t change) containing another component (that did change).

    Create componentX containing <componentY [someprop]=’abc’>, remove someprop from componentY.ts without touching componentX template – no error until rebuild or componentX changes.

    test-a.html :

    
    <app-test-b [x]="1"></app-test-b>
    

    test-b.ts:

    
        @Input() x: number;
        constructor() { }
    

    Leave only test-b.ts open, as you remove/add in test-b.ts @Input() x: number; without touching other files, errors are sometimes shown sometimes not (on remove) or sometimes disappear sometimes not (on add) depending on the build state.

    #545438 Reply

    Brian Fernandes
    Moderator

    Fedor,

    Thanks for the additional details – I could reproduce this rather simply; I’m sure we could do something smarter here.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Template does not validate until full build or template source edit

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in