Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • 05:53
    amariq commented #43511
  • 05:52
    PowerKiKi synchronize #43562
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
hgrubst
@hgrubst
@brandonroberts Ok that's what I thought. The reason I want that is to do a wizard style form with multiple step. I like having the steps configured in one central place for which the router makes sense. The fact that you can add arbitrary data to routes makes this even more convenient. With this you can then write a breadcrumb component which renders the wizard steps to the user.
@brandonroberts I can hardcode the routes in my component for now. Would be a nice addition to the router I think though.
Zahadi Eslicho
@panKt
@robwormald That’s it, thanks :)
Rob Wormald
@robwormald
@qdouble looking at the docs, i'd probbaly just add a directive to the captcha element
Zahadi Eslicho
@panKt
@robwormald ok, I untimely said it is ok, check it out http://plnkr.co/edit/siMNH53PCuvUBRLk6suc?p=preview this one also says
No provider for RouteParams!
if you click on Protected Page link
Rob Wormald
@robwormald
i dunno that it'll work, to be honest.
Anthony
@qdouble

@robwormald the method that loads the script is this

 <script type="text/javascript">
        var onloadCallback = function() {
            grecaptcha.render('html_element', {
                'sitekey' : '6Le79xETAAAAAJbY1zuL68LGdlmJHdFRDn8To6h9'
            });
        };
    </script>

then embedded in the index html is this

<script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"
            async defer></script>

I get you as far as using a directive to access the captcha element, but as far as calling the function in angular... I just need to load that on the component? will it communicate with the google script in a straightforward way?

Zahadi Eslicho
@panKt
@robwormald I was able to inject some of my services that way, even Angular's Router but not RouteParams :(
Rob Wormald
@robwormald
routeParams are scoped to the component, so they may not be available
there will be a better solution for this, which is why i linked you to that commnet
Zahadi Eslicho
@panKt
you mean @Resolve?
Rob Wormald
@robwormald
he says in the comment - allowing bindings to be passed through
Zahadi Eslicho
@panKt
oh… Sep 14,I thought he changed his mind already :)
Rob Wormald
@robwormald
Anthony
@qdouble
@robwormald you're the man, thanks! :+1:
updated to actually work, just registered a key for plunker
note the thing in index - i'm wrapping the callback in a promise, so i can basically store it and re-access it later
Rob Wormald
@robwormald
Anthony
@qdouble
@robwormald yes, I saw the promise part.... how do you access the verified value that's in the directive from the component, so you can send it with the submission?
@robwormald...yeah, the new one is even cleaner... you should post this up on github since I don't see any solution for this stuff published out there yet and I'm sure it'd help a lot of folks
better, using inputs/outputs
you publish it on github, by all means. i have enough OSS crap to track on the regular, thank you ;)
Richard Bateman
@taxilian
does anyone know if there is anything current which illustrates best practices for angular 1.5 components in typescript? I've found a few articles that seem almost contradictory, and I'm not sure if that's just multiple ways of doing the same thing or if something has changed
I ask here because I'm trying to get as close to angular2 as I can while I still can't move to it :-/
Anthony
@qdouble
@robwormald lol, sure :smile: