This topic contains 3 replies, has 2 voices, and was last updated by Jai Jai 1 year, 8 months ago.

Header Profile component stop working when added ng Forms


  • shanalikhan
    Participant

    Posts: 5
    Member Reply #11142

    Hello,

    I have been using the theme

    I did one change in the “header-profile” component.

    Importing “FormsModule” in header-profile module

    and adding a form submit as(ngSubmit)=”createUser()”

    and changed input as
    <label for=”example-text-input” class=”col-2 col-form-label”>
    First Name
    </label>
    <div class=”col-7″>
    <input class=”form-control m-input” [(ngModel)]=”newUser.FirstName” type=”text” >
    </div>
    The problem i got is that ng model didnt work, also when this component is called from click My Profile like the default theme, this component gets append to the existing index component page.

    Even i change the value in component load in TS File it dont reflect the value in input text box in the view.

    Are you sure there is no error in the theme for this senario or i’m doing any thing wrong ?

     

    • This topic was modified 1 year, 8 months ago by  shanalikhan.
    • This topic was modified 1 year, 8 months ago by  shanalikhan.
    Jai
    Jai
    Keymaster

    Posts: 2715
    Support Staff Reply #11150

    Hi 🙂

    Can you try to remove {provide: ErrorHandler, useClass: GlobalErrorHandler} from theme/dist/angular/default/src/app/app.module.ts

    Retry to load the page, and check the console log if there is any errors related to NgForm.

    Thanks


    shanalikhan
    Participant

    Posts: 5
    Member Reply #11154

    ok Thanks, it worked

    Jai
    Jai
    Keymaster

    Posts: 2715
    Support Staff Reply #11174

    Hi 🙂

    Cool. Thanks and good luck with your projects.

    Thanks

Tagged: 

You must be logged in to reply to this topic.