- I am new to typescript and angular 2.
- I am trying to include my my tabs code in typescript method and run it but its not running.
- i am trying to put in a method so that I can write a test case by callling that method.
- i used angular 2 click (click)="myFunc()" but its not working
- can you guys tell me how to fix it.
- providing my code and error below
https://jsfiddle.net/z4vo5u5d/409/
error:
VM212:11 Uncaught ReferenceError: require is not defined
at eval (eval at exec (VM85 typescript.js:41), <anonymous>:11:14)
at exec (VM85 typescript.js:41)
at HTMLDocument.runScripts (VM85 typescript.js:41)
code:
<li (click)="myFunc()" class="tab-link current" data-tab="tab-1">Tab One</li>
var tab_id = $(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
}