Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 07:23
    spike-rabbit synchronize #43535
  • 07:22
    JoostK transferred #43565
  • 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
Anthony
@qdouble
@crystalbyte I think it's been said a few times on here that angular and other frameworks are purposely set up for there not to be direct dom access
Alexander Wieser
@crystalbyte
@qdouble How do you then for instance call setTimeout, which sometimes is necessary in order for angular to work properly ?
Eric Martinez
@ericmartinezr
like this
setTimeout(() => { ... }, time);
Alexander Wieser
@crystalbyte
@ericmartinezr I know this is possible, I just thought there is a more clean way to call window methods apart from the global scope.
Justin DuJardin
@justindujardin
@crystalbyte Use TimerWrapper perhaps?
import {TimerWrapper} from "angular2/src/facade/async”;
Eric Martinez
@ericmartinezr
I don't think calling a wrapper for something global is cleaner. You're wrapping B in A to use B, doesn't really make sense to me. Internal wrappers have another purpose in the internal API.
Alexander Wieser
@crystalbyte
@justindujardin Thanks, however this does only solve the problem for a single method, I was hoping for a more generic way to access the root objects.
Perhaps it's just me, I come from the C++/C# land far far away, where the global scope has been banished from the lands :P
Justin DuJardin
@justindujardin
Updated material components, with better test coverage and a revamped example site making use of the new peekaboo component. https://justindujardin.github.io/ng2-material/
Rob Wormald
@robwormald
don't use the wrappers :) they're internal
hgrubst
@hgrubst
Hello, I'm trying to programatically access all the route definitions of my top level Router. Something similar to what $state.get() does in ui-router. Is there anyway this can be done ?
Alexander Wieser
@crystalbyte
Is there a way to trigger an http observable, such as http.get to fetch the data multiple times or do I need to create a new one each time and replace the old ?
Rob Wormald
@robwormald
you can just resubscribe to it
though it depends what you're looking to do - polling? or?
Alexander Wieser
@crystalbyte
@robwormald Lets just say I need to refresh the data coming from a get request. I was hoping to be able to call this.items.refresh() so the entire sequence is simply run again.
Rob Wormald
@robwormald
there's a couple of ways you could do it
Rob Wormald
@robwormald
Alexander Wieser
@crystalbyte

@robwormald I'd love to hear them ;) Perhaps you could explain to me if its possible to bind directly against a single Observable. When using the ngFor directive I can simply use the async pipe

<section *ngFor="#p of profiles | async"></section>

How do I do that directly without using *ngFor.

Rob Wormald
@robwormald
the same way - though typically i would have a profile component and do something like <profile [data]="profile | async">
Alexander Wieser
@crystalbyte
Isn't it overkill to create an entire component merely for fetching some json data?
Rob Wormald
@robwormald
not for fetching
for displaying
to encapsulate the profile or whatever
Alexander Wieser
@crystalbyte
@robwormald Thanks for the plunker, I am currently trying to understand how it works.
Rob Wormald
@robwormald
there's basically two sequences
the initial load
Alexander Wieser
@crystalbyte
@robwormald Ok, so we fetch the data into the [data] property from the Observable profiles, thanks.
Rob Wormald
@robwormald
and then another which is a sequence of clicks -> mapped to requests
and then they just get concatted together into a single sequence
Eric Martinez
@ericmartinezr
:point_up: 28 de Diciembre de 2015 12:06 @robwormald sorry for insisting, do you have any comments on that question?
Rob Wormald
@robwormald
didn't see that question
if its a single-value-sequence (like an http request) the manual cleanup is unnecessary (assuming you subscribe in the controller manually)
if its an infinite sequence, you should unsubscribe
which the async pipe does for you,
Eric Martinez
@ericmartinezr
got it, thanks :+1:
Rob Wormald
@robwormald
i should say "if its a sequence that completes"
(of which single value sequences, a la http, are one)
Alexander Wieser
@crystalbyte
@robwormald Are you sure that the http sequence completes ? I tried using .finally() on it and it was never invoked, it should, however, if complete is being called.
Or is complete called after ngOnDestroy ?
Brandon
@brandonroberts
@hgrubst there isn't a built-in way currently possible to get the route definitions once they are configured. Depending on what you need you can get some of that data from the instruction or route data if you need something custom.
Rob Wormald
@robwormald
yes, i'm sure :)
Zahadi Eslicho
@panKt

Once I do injector.get(RouteParams) it throws No provider for RouteParams!
Where shall I look?

P.S. here is bootstrap

  return bootstrap(App, [
    HTTP_PROVIDERS,
    ROUTER_PROVIDERS
  ])
Anthony
@qdouble
@robwormald I'm trying to see what would be the best way to incorporate google's recaptcha as no one has put out any code for it yet for Ang2, any recommendations on what would be the best way to approach?
Rob Wormald
@robwormald
how does it work?
@panKt you dont need to be using the injector
Anthony
@qdouble
@robwormald well this is how someone wrote the script for it to work on Ang 1, not sure if I would have to just try to rewrite it for Ang2 or look into using lifecycle hooks and elementref https://github.com/VividCortex/angular-recaptcha/tree/master/src
Zahadi Eslicho
@panKt
@robwormald actually I’m trying to write some code inside @CanActivate decorator. And in that code I need to refer to RouteParams
but because Component is not created on @CanActivate cycle, I need to inject it