From c77c829e4410fd134799ce91b1d756a9eb47cb68 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 26 Mar 2018 21:56:14 -0700 Subject: [PATCH] feat(ImageSource): support ImageSource object properly --- .gitignore | 1 + demo/app/main-page.ts | 7 + demo/app/main-page.xml | 3 +- src/image-zoom.android.ts | 11 +- src/image-zoom.common.ts | 2 +- src/image-zoom.ios.ts | 2 +- src/package-lock.json | 496 -------------------------------------- 7 files changed, 20 insertions(+), 502 deletions(-) delete mode 100644 src/package-lock.json 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 @@ - +