hi, i am using jquery and anuglar 2. i am having a little bit problem with 
jquery. 

here is my sample code:

 

*Html:*

<form class="form-horizontal" (ngSubmit)="…..">

<input class="form-control" id='Target1' />

       <div *ngIf="student">

           <input id='Target2' class="form-control" 
[(ngModel)]="student.Name"  />

     </div>

<input id='Target3' class="form-control" />

</form>

 

*TypeScript:*

student:Student; // From Service

    ngAfterViewInit() {

            $('#Target1').click(function () {

                alert("Testing 1");

            });

 

            $('#Target2').click(function () {

                alert("Testing 2");

            });

 

     $('#Target3').click(function () {

                alert("Testing 3");

            });

    }

 

    ngOnInit() {

        let id = +this._routeParams.get('id');

        //Http Service provider

       ………………………………………….

       …………………………………………

            /*$('#Target1').click(function () {

                alert("Testing 1");

            });

 

            $('#Target2').click(function () {

                alert("Testing 2");

            });

 

     $('#Target3').click(function () {

                alert("Testing 3");

            });*/

    }

 

where Target 1 and Target 3 are working well when i clicked input type of 
text. Target 2 is not working because i doubt that it is not working after 
ngIF="student". How do i fix it? i am waiting for your response. Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to