У меня есть компонент с именем abc, и в этом компоненте у меня есть три переменные с именем title, Desc, Name, и когда я пытаюсь получить к нему доступ из вложенной функции, она выдается как неопределенная.
, например
@Component({
selector: 'abc',
templateUrl: './abc.component.html',
styleUrls: ['./abc.component.css'],
providers: [abcService]
})
export class abcComponent implements AfterViewInit,AfterViewChecked {
title;
Desc;
Name;
date=null;
test(){
this.title='a';
//work fine
}
test11(){
$('#cmg tbody').on('click', 'a.editor_edit', function (e) {
e.preventDefault();
this.title= false; //gives me an undefined
});
}
}