Posts by marcosvolpato • 76 points
7 posts
-
1
votes1
answer1462
viewsA: How to make a function wait another function that has an subscribe with observable in?
Use Subject, it would look something like this: import { Subject } from 'rxjs'; private listReady = new Subject(); ngOnInit() { this.otherSubscription = this.listReady.subscribe( () => {…
-
0
votes2
answers707
viewsA: Exchange value of a variable of another Angular component
You can also pass a flag in the url import { ActivatedRoute } from '@angular/core'; @Component(...) export class SeuComponent { public justLogout = false; constructor( private route: ActivatedRoute…
-
0
votes1
answer95
viewsA: Set, pick up and check a Cookie after a video (Youtube API) finishes - Javascript
//[Interações] // criar player youtube var player; function onYouTubePlayerAPIReady() { player = new YT.Player('player',…
-
0
votes2
answers45
viewsA: Returning manager in template (Django)
Do this on view.py #views.py class BookList(ListView): # ... books_published = Book.objects.filter(published=True) and in the template: # template.html <p>Livros publicados: {{…
-
1
votes1
answer145
viewsA: Is there any risk in using Django’s Token generator in different services?
You can use: import binascii import os numero_de_caracteres = 15 token = binascii.hexlify(os.urandom(numero_de_caracteres)) print(token) The above code generates a 15-character string randomly and…
-
1
votes2
answers442
viewsA: How to go to a Django url regardless of the path we are on?
What Puam Dias answered is correct. Just remember that to use this tag you need to name the route in the urls.py file urlpatterns = [ url(r'^perfil/$', perfil_function, name='perfil'), ] It is the…
-
0
votes1
answer95
viewsA: Changing the place templates (Django)
Execute the command: ./manage.py collectstatic