Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:16
    preetham1290 opened #43565
  • 07:06
    amariq commented #43511
  • 07:05
    amariq commented #43511
  • 07:00
    amariq commented #43511
  • 06:22
    pullapprove[bot] review_requested #43564
  • 06:22
    google-cla[bot] labeled #43564
  • 06:21
    enisfr opened #43564
  • 06:18
    enisfr closed #43558
  • 06:18
    enisfr commented #43558
  • 06:16
    enisfr synchronize #43558
  • 06:11
    alan-agius4 synchronize #43417
  • 06:07
    enisfr synchronize #43558
  • 06:05
    enisfr synchronize #43558
  • 06:01
    JoostK commented #43511
  • 06:01
    enisfr synchronize #43558
  • 05:56
    Ajaykrishnancreations starred angular/angular
  • 05:55
    amariq commented #43511
  • 05:54
    amariq commented #43511
Eric Martinez
@ericmartinezr
yep
Aleš
@fxck
nothing new there if you've seen all the other videos : ) it's basically introduction into observables
Eric Martinez
@ericmartinezr
It's always useful to be remembered of everything you've seen before :P
Aleš
@fxck
fortunately, @robwormald is working on 60 part egghead series about reactive programming, rxjs, redux and angular2, it's gonna be all we've ever dreamt of, no more stupid counter/todo examples everyone has seen thousand times! : )
Eric Martinez
@ericmartinezr
He totally should make a backup of everything he has answered in this chatroom
Soroush Gholamzadeh
@s-o-r-o-u-s-h
@ericmartinezr Hi,could you pls check your private messages?
jeff
@jjarrell50
@robwormald - (currenttime-changed), indeed simpler and more angular2 idiomatic. Thank you.
Eric Martinez
@ericmartinezr
@s-o-r-o-u-s-h that's a question that you should ask here, not in private :P. You'll have more chances to have a good answer
Ville Vainio
@vivainio
Rx needs less tutorials and "mind blowing stuff"
Rob Wormald
@robwormald
?
Soroush Gholamzadeh
@s-o-r-o-u-s-h
@ericmartinezr But it was your approach specifically ;-)
The only thing that I need is a code example
Eric Martinez
@ericmartinezr

@s-o-r-o-u-s-h this is my approach

this._replay = new ReplaySubject(1);
http.get('URL').subscribe(this._replay);
get replay()  {
   return this._replay;
}

That would be inside the service, then from the components I do service.replay.subscribe(res => /* do something with result */)

That works for me, is it the best approach? I don't know, that's why you should ask here :P
Soroush Gholamzadeh
@s-o-r-o-u-s-h
Thank you :+1:
Eric Martinez
@ericmartinezr
:+1:
Ville Vainio
@vivainio
Meaning: Observables should be treated more "this is how callbacks work now" (like promises before that), not "reactive programming revolution is here and no codebase is safe" (as that can be intimidating)
Daniel
@gaiottino
Is it no longer possible to use a regular link-tag to call a route without reloading the page?
The <a [routerLink] syntax is often very combersome
Aleš
@fxck
@gaiottino there might be a new syntax
comming soon...ish
Daniel
@gaiottino
Ah. Cool. Thanks
James Pacileo
@jamespacileo
@robwormald > this is where the webworker integration is nice, if you're doing something realllly heavy
Thanks for the suggestion!
Eric Martinez
@ericmartinezr
@robwormald :point_up: 28 de Diciembre de 2015 10:48 in the hangout talk at 27:40 you talk about Observables cleaning up themselves, is that always the case? Is it necessary to us to unsubscribe in ngOnDestroy for example, as a good practice?
Eric Martinez
@ericmartinezr
@robwormald for example in AsyncPipe you handle the unsubscription manually (maybe because it supports Promises too?)
James Pacileo
@jamespacileo
Might be a silly question but... can an individual component run in a web worker? Rather than the whole app?
Ghost
@ghost~5539edbc15522ed4b3df7357
Hi. Can I lazy-load components depending on information only available at runtime? So a REST API returns a set of components that I can use and their URLs and my application then displays said components to the user?
Daniel
@gaiottino
import {Component} from 'angular2/core'

@Component({
  selector: 'gridifier',
  template: `
    <div class="gridifier">
      <ng-content></ng-content>
    </div>
  `
})
export class Gridifier {
  ngOnInit() {
    var grid = new (<any>window).Gridifier($('.gridifier'), {
      query: '> div',
      dragifier: true
    })
    grid.append(grid.collectNew())
  }
}
How should I rewrite the above component to get rid of $('.gridifier')? Not sure what the best practice is when wrapping a jQuery plugin like that.
James Pacileo
@jamespacileo
do you mean document.getElementByClassName('gridifier')?
Daniel
@gaiottino
Well that's more or less the same. Direct access to the DOM. I wanted something similar to ElementRef but not sure that's what I should use... it has a big red warning box ;)
Eric Martinez
@ericmartinezr
@gaiottino
@Component({
  selector: 'gridifier',
  template: `
    <div class="gridifier" #gridifier>
      <ng-content></ng-content>
    </div>
  `
})
export class Gridifier {
  @ViewChild('gridifier') gridifier;
  ngOnInit() {
    var grid = new (<any>window).Gridifier(this.gridifier.nativeElement, {
      query: '> div',
      dragifier: true
    })
    grid.append(grid.collectNew())
  }
}
Daniel
@gaiottino
Ah. There's an annotation I've not seen yet. Thanks. Gonna head over to the docs :)
@ericmartinezr get an error Cannot read property 'nativeElement' of null. Tried inside ngAfterViewInit as well but same result
Eric Martinez
@ericmartinezr
make a plnkr
@gaitottino Oh, yeah, it must be on ngAfterViewInit http://plnkr.co/edit/Pm268dYmQ6lu9BvPH6kr?p=preview
Daniel
@gaiottino
ah. and #gridifier. Thanks
AngryPowman
@AngryPowman
Hey guys, is there angular material suitable for desktop app development?
Daniel
@gaiottino
@ericmartinezr how would I update that gridifier to run once ng-content changes? If the contents are rendered from a promise
Vlado Tesanovic
@vladotesanovic
@AngryPowman take a look on this example https://github.com/auth0/angular2-electron
Daniel
@gaiottino
Ok. So I found ngAfterContentChecked. But moving grid.append(grid.collectNew()) there just seems to call ngAfterContentChecked in an infinite loop. :-/
AngryPowman
@AngryPowman
@vladotesanovic Thanks, I am using electron for my solution with AngularJS, and now i am looking for an UI framework which is best for it.
choeller
@choeller

Hi guys! I'm just having kind of a mental problem understanding the basics of Observables... So my question basically boils down to one thing: So in this Rx.js world we have an Observable that represents the datasource. Now I can subscribe an Observer to that Observable - so in my understanding the Observer is the function that I pass to the "subscribe"-method... is that correct? If so, I just dont get this syntax:

Observable.create((observer) => {
      observer.next(5);
      observer.next(10);
    })

Why is the "thing" that emits the new values the observer?! can anyone put that in simple words for an rxjs newbie? :grimacing:

@gaiottino did you already try ngAfterContentInit?
I think ngAfterContentChecked is called every time change detection runs...
Daniel
@gaiottino
@choeller since the content is updated async, the child elements werent available in ngAfterContentInit but i think I might have to make a service from it.
It seems that ngAfterContentChecked is being triggered excessively when a mouse listener is active. hmm.
choeller
@choeller
@gaiottino hmm, I see... do you have a plnkr of that?