Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 12:45
    dario-piotrowicz commented #43218
  • 12:42
    dario-piotrowicz synchronize #43218
  • 12:37
    dario-piotrowicz commented #43831
  • 12:30
    dario-piotrowicz reopened #43604
  • 12:26
    dario-piotrowicz synchronize #43831
  • 11:54
    mary-poppins commented #43931
  • 11:48
    gkalpak ready_for_review #43931
  • 11:48
    gkalpak review_requested #43931
  • 11:48
    gkalpak labeled #43931
  • 11:48
    gkalpak edited #43931
  • 11:46
    gkalpak synchronize #43931
  • 11:29
    mary-poppins commented #43931
  • 11:28
    dario-piotrowicz closed #43604
  • 11:20
    ngbot[bot] milestoned #43931
  • 11:20
    gkalpak labeled #43931
  • 11:20
    gkalpak labeled #43931
  • 11:20
    gkalpak labeled #43931
  • 11:20
    google-cla[bot] labeled #43931
  • 11:20
    gkalpak opened #43931
  • 10:14
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:
Shuhei Kagawa
@shuhei

Hi guys, are there any substitutions for parameter decorators for ES5 and ES2015 users?

I'm the author of babel-plugin-angular2-annotations, which is a babel plugin that supports Angular 2's type annotations and parameter decorators that are not supported by babel. The parameter decorators are supported by monkey-patching babel's parser. Recently the babel team decided to forbid monkey-patching its parser. So I'm looking for ways to use metadata like @Attribute, @Query and etc.

shuhei/babel-plugin-angular2-annotations#16

Rob Wormald
@robwormald
"Recently the babel team decided to forbid monkey-patching its parser"
? that seems strange - what are plugins supposed to do?
read the thread. bummer
did you talk to them on slack?
perhaps there's a better API to use
Shuhei Kagawa
@shuhei
Not yet. But another guy monkey-patching it did. I'll try later but will get no luck.
Rob Wormald
@robwormald
they're reasonable people. i'd jump on slack and see if they have any suggestions
Shuhei Kagawa
@shuhei
ah, thanks!
Rob Wormald
@robwormald
its probbaly more to do with how you're doing it, vs why you're doing it
Shuhei Kagawa
@shuhei
Posted a comment.
By the way, what's the recommended way to use @Attribute and @Query in ES5? I couldn't find it in the docs.
Hussain
@hussainb
Hello, I have created a component(directive) and have created custom attribute variables, they work fine and I get the strings passed through the component, Now I want to pass a function from one component to the other using this principle. how can I do it?
I am using the @Input('custom-attribute') to pass strings to the component from the markup right now
I now would like to pass a callback function the same way
Anthony
@qdouble
@robwormald I installed your script in my app and it works just fine... still a typescript newb though, what's the best way to get rid of these compiler errors generated from the recpatcha.ts file?
Error:(6, 12) TS2339: Property 'onloadCaptcha' does not exist on type 'Window'.
Error:(7, 24) TS2339: Property 'grecaptcha' does not exist on type 'Window'.
Error:(31, 22) TS2339: Property 'render' does not exist on type '{}'.
Hussain
@hussainb
My directive is receiving the attribute as string, how can I pass it as a function?
Got it to work had to add square brackets: [custom-attribute]="functionName"
Rob Wormald
@robwormald
@hussainb typically you should emit an event rather than passing in a function. not always, but typically
Hussain
@hussainb
Sure, I need to look into how to do that
Rob Wormald
@robwormald
depends what the use case is, generally
Hussain
@hussainb
Right now, I have a global nav component
It has few golbal things like alerts, modals etc
Rob Wormald
@robwormald
@qdouble heh, that's one thing that sort of sucks with typescript.