How to call angular method in html?

Hatice Sebli

I'm using *ngFor(*ngFor="let radio of items) in div element and inside of this div , using an img element.I am trying to set the src like [src]="radio.getIsActiveIcon()" but "46 ERROR TypeError: _v.context.$implicit.getIsActiveIcon is not a function at Object.eval [as updateRenderer] " error happens. My img element and getIsActiveIcon func is;

<img class="is-active-image" [src]="radio.getIsActiveIcon()">

public getIsActiveIcon(): string {
    if (this.isActive === 1) {
        return 'assets/img/ic_active.png';
    }
    return 'assets/img/ic_not_active.png';
}
Hatice Sebli

Finally,I used Pipe and it works.it's more clear.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Angular: how to call a Typescript method in html

From Dev

Angular 2 call super method from html

From Dev

Angular 2 How to call a component method from index.html(script)?

From Dev

How call method validation for formGroup Angular 2?

From Dev

How to call parametrized method in ngOnInit in Angular?

From Dev

How to call public method of ViewChild in Angular 10

From Dev

How do you call this method ( Angular 5 )?

From Dev

How to call a method from another component in Angular?

From Dev

How to call method from component Angular?

From Dev

How to call an async method in canActivate | Ionic ,Angular

From Dev

How to call a helper method with & without html option

From Dev

how to call a method from html page to a class

From Dev

call Angular 2 component method from html event

From Dev

Call a component method from HTML in Angular2

From Dev

call a method inside a ngFor in my html (angular6)

From Dev

angular testing a component using jasmine when the a method call is made in the html

From Dev

How to call a rootscope fuction in html - Angular Js

From Dev

How to call a method in HTML other than (click)="method()"

From Dev

How to return HTML expression from Angular method?

From Dev

how to call angular2 method after resolving jQuery promise

From Dev

Angular: How to call component method from another component in different modules

From Dev

How to verify ngCopy method call in angular 6 unit test

From Dev

How to access Angular 2 router in Meter.call() method

From Dev

How to call an http method without the observable in Angular 2

From Dev

How to call an Angular 4 method from a standalone plain JavaScript function?

From Dev

Angular | how to call a ngonit() method from another component

From Dev

How to call a method from a JS file into an Angular component

From Dev

How To call/check values inside a method in UnitTest Angular4

From

How to call component method from service? (angular2)

Related Related

  1. 1

    Angular: how to call a Typescript method in html

  2. 2

    Angular 2 call super method from html

  3. 3

    Angular 2 How to call a component method from index.html(script)?

  4. 4

    How call method validation for formGroup Angular 2?

  5. 5

    How to call parametrized method in ngOnInit in Angular?

  6. 6

    How to call public method of ViewChild in Angular 10

  7. 7

    How do you call this method ( Angular 5 )?

  8. 8

    How to call a method from another component in Angular?

  9. 9

    How to call method from component Angular?

  10. 10

    How to call an async method in canActivate | Ionic ,Angular

  11. 11

    How to call a helper method with & without html option

  12. 12

    how to call a method from html page to a class

  13. 13

    call Angular 2 component method from html event

  14. 14

    Call a component method from HTML in Angular2

  15. 15

    call a method inside a ngFor in my html (angular6)

  16. 16

    angular testing a component using jasmine when the a method call is made in the html

  17. 17

    How to call a rootscope fuction in html - Angular Js

  18. 18

    How to call a method in HTML other than (click)="method()"

  19. 19

    How to return HTML expression from Angular method?

  20. 20

    how to call angular2 method after resolving jQuery promise

  21. 21

    Angular: How to call component method from another component in different modules

  22. 22

    How to verify ngCopy method call in angular 6 unit test

  23. 23

    How to access Angular 2 router in Meter.call() method

  24. 24

    How to call an http method without the observable in Angular 2

  25. 25

    How to call an Angular 4 method from a standalone plain JavaScript function?

  26. 26

    Angular | how to call a ngonit() method from another component

  27. 27

    How to call a method from a JS file into an Angular component

  28. 28

    How To call/check values inside a method in UnitTest Angular4

  29. 29

    How to call component method from service? (angular2)

HotTag

Archive