Code Monkey home page Code Monkey logo

Comments (7)

bradmartin avatar bradmartin commented on May 23, 2024

I've not gotten into angular2 yet. Is there another alternative to ngIf, my
guess is that's removing it from the tree, but I don't know. Have you tried
just setting the visibility=false when you want to hide one from the view?
Another option might be to animate it out of the screen and adjust the
opacity so it's not visible and then bring it back.

On Wed, Nov 16, 2016, 11:43 AM Eduardo Sanchez [email protected]
wrote:

I need to have different drawing areas but in the same place, so I need to
hide and show the DrawingPads depending on a variable:

This is an example of the code:
<template ngFor let-dp let-i="index" [ngForOf]="[1,2,3,4]">
<DrawingPad *ngIf="i == variable" col="0" height="200"
id="drawingPad-{{i}}" penColor="#000" penWidth="3">

But if I draw something in Pad#1, change to Pad#2 (which is empty, as
expected) and the back to Pad#1, the Pad#1 is empty... I need them to keep
what was drawn.

Any ideas how to achieve this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#12, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AFulhG87V2ULRycpQTPlxOe0UD87mVKXks5q-0C5gaJpZM4K0NOs
.

from nativescript-drawingpad.

eleddie avatar eleddie commented on May 23, 2024

I think it might be loosing the reference and when it shows again it creates a new reference. Is there a way to set the value of the DrawingPad? Like when you do pad.getMyDrawing() and it returns a Promise with the image, set that image returned to a DrawingPad value

from nativescript-drawingpad.

bradmartin avatar bradmartin commented on May 23, 2024

Don't think there's an easy way to take the image and back into the drawing
view. What you could do is layer an image on top of the drawing view and
put the image to the src and then draw on top of the layer.

On Wed, Nov 16, 2016, 12:27 PM Eduardo Sanchez [email protected]
wrote:

I think it might be loosing the reference and when it shows again it
creates a new reference. Is there a way to set the value of the DrawingPad?
Like when you do pad.getMyDrawing() and it returns a Promise with the
image, set that image returned to a DrawingPad value


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFulhAM_VUbDIU20HTK7LSNS3vprP8Peks5q-0sJgaJpZM4K0NOs
.

from nativescript-drawingpad.

eleddie avatar eleddie commented on May 23, 2024

Is it possible to create the DrawingPad object programmatically and then append it to the view? That way the reference isn't lost..

from nativescript-drawingpad.

eleddie avatar eleddie commented on May 23, 2024

I just solved the problem by using visibility: collapsed; and visibility: visible; depending on the state, instead of *ngIf. Thanks for your help. I'll dig more into it to se if there's a better way.

from nativescript-drawingpad.

bradmartin avatar bradmartin commented on May 23, 2024

My guess then Is that ngIf removes the view from the tree so it renders new
when added back. Or so it seems that way

On Thu, Nov 17, 2016, 7:38 AM Eduardo Sanchez [email protected]
wrote:

I just solved the problem by using visibility: collapsed; and visibility:
visible; depending on the state, instead of *ngIf. Thanks for your help.
I'll dig more into it to se if there's a better way.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#12 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFulhJD_SvI84Vpw8KgT_kd-BDG3KThWks5q_FjVgaJpZM4K0NOs
.

from nativescript-drawingpad.

eleddie avatar eleddie commented on May 23, 2024

Yes, that might be. Thanks for your help and quick response!

from nativescript-drawingpad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.