Skip to content

Commit

Permalink
fix(): useImg can be used without setting value to true
Browse files Browse the repository at this point in the history
closes #7
  • Loading branch information
ihadeed committed Dec 30, 2016
1 parent 51c2e35 commit d91d35a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/img-loader/img-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ export class ImgLoader implements OnInit {
/**
* Use <img> tag
*/
@Input() useImg: boolean;
@Input()
set useImg(val: boolean) {
this._useImg = (val != false);
}

private _useImg: boolean;

/**
* Width of the image. This will be ignored if using useImg.
Expand Down Expand Up @@ -127,7 +132,7 @@ export class ImgLoader implements OnInit {

this.isLoading = false;

if (this.useImg) {
if (this._useImg) {

// Using <img> tag
this.renderer.createElement(this.element.nativeElement, 'img');
Expand Down

0 comments on commit d91d35a

Please sign in to comment.