0

So I have an SPA in angular. I want to insert a QR code, using a jquery plugin.

All my controllers and my javascript are in my index.html. When user visits screen.html or keybord.html , there is another small page inside those pages

the controller of qr.html has

jQuery('#cardQR').qrcode({
        text :"yo"
}); 

When I first go to screen.html the QR is there, if I go to keybord.html or go back to screen.html the QR renders for half a second and gets lost.

I guess the QR jquery plugin gets loaded once in index.html and never again because index does not reloads again, only screen or keybord. I may be wrong.

I dont know how to fix this. Any tips?

Thanks

1
  • Please share your code. Commented Mar 31, 2016 at 9:31

1 Answer 1

1

Using jQuery in Angular controllers is usually really bad practice, I would advise you to use something like angular-qrcode for a more 'Angular way' implementation.

As for your question, this isn't possible to answer without seeing more of your code, could you create a fiddle/plunkr ?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.