diff --git a/.gitignore b/.gitignore index ffd6809..b5c4ac1 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ publish/src publish/package demo/report/report.html demo/report/stats.json +src/package-lock.json diff --git a/demo/app/main-page.ts b/demo/app/main-page.ts index 1550297..ff07e8a 100644 --- a/demo/app/main-page.ts +++ b/demo/app/main-page.ts @@ -1,5 +1,6 @@ import * as observable from 'tns-core-modules/data/observable'; import * as pages from 'tns-core-modules/ui/page'; +import { ImageSource, fromResource } from 'tns-core-modules/image-source'; import { HelloWorldModel } from './main-view-model'; import { ImageZoom } from 'nativescript-image-zoom'; @@ -23,3 +24,9 @@ export function loadResource() { image.src = 'res://image_302063'; } } + +export function loadImgSrc() { + if (image) { + image.src = fromResource('image_302063'); + } +} diff --git a/demo/app/main-page.xml b/demo/app/main-page.xml index 1bd378f..db81498 100644 --- a/demo/app/main-page.xml +++ b/demo/app/main-page.xml @@ -1,9 +1,10 @@ - +