Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 00:53

    copybara-service[bot] on g3

    perf(compiler-cli): reduce anal… refactor(compiler): store modif… refactor(compiler): remove dire… and 1 more (compare)

  • 00:52
    huldson2 starred angular/angular
  • 00:38
    amitbeck commented #44746
  • 00:35
    dylhunn synchronize #43834
  • 00:32
    AndrewKushnir commented #44359
  • 00:20
    dylhunn closed #44748
  • 00:20

    dylhunn on master

    refactor(forms): Make a couple … (compare)

  • 00:20
    dylhunn commented #44748
  • 00:19
    dylhunn labeled #44748
  • 00:19
    dylhunn unlabeled #44748
  • 00:18
    dylhunn labeled #44748
  • 00:18
    AndrewKushnir labeled #44359
  • 00:06
    dylhunn commented #44746
  • 00:06
    dylhunn commented #44746
  • 00:06
    dylhunn commented #44746
  • 00:00
    AndrewKushnir synchronize #44359
  • Jan 18 23:52

    dylhunn on 13.1.x

    refactor(animations): change er… (compare)

  • Jan 18 23:52
    dylhunn closed #44726
  • Jan 18 23:52

    dylhunn on master

    refactor(animations): change er… (compare)

Rob Wormald
@robwormald
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.
Hussain
@hussainb
I just need need to customize their behavior from different components
Rob Wormald
@robwormald
or just do window['whatever'] = whatever
@hussainb i'd probably use DI to do this, if its configuration type stuff
Hussain
@hussainb
no not config
Take an example, I need to show plain alerts, but need to change the text between diffenernt components
Rob Wormald
@robwormald
[bindings] are fine then
Hussain
@hussainb
So, I pass a callback having the alert its own text and fire the callback when an input on the nav component is clicked
yes
Rob Wormald
@robwormald
yeah, that would be better served with (click)
Hussain
@hussainb
yep
Rob Wormald
@robwormald
not [somefuncitontobecalled]
Hussain
@hussainb
Oh ok
Rob Wormald
@robwormald
properties go in with [bindings]
events come out with (eventName)
Hussain
@hussainb
ok
Rob Wormald
@robwormald
also, for stuff like an alert, you're better to use a service to control it
Hussain
@hussainb
oh, true
Zahadi Eslicho
@panKt

Let’s say I'll put some data into route that will show that this route needs auth.
Is there some global way to intercept navigation to that route and
1) Find out if that route needs an auth
2) Redirect to login page if there is no auth
3) Of course component that represents that route should not be created if there is no auth
3) View should not be rendered if there is no auth

@CanActivate can do similar thing, but it needs to be added on components. I'm looking for a way to avoid that copy-paste on every component

Hussain
@hussainb
I will look into using a service instead.
Anthony
@qdouble
@robwormald thanks, ['whatever'] does the job just fine
Rob Wormald
@robwormald
Hussain
@hussainb
@robwormald , OK, looking at it
Oh, this is the alert service!
Rob Wormald
@robwormald
so the service is injected into the component, and then you can also inject it into any other component or service
Hussain
@hussainb
Yes!
@robwormald, ThankYou!
Anthony
@qdouble

@robwormald one last bit of functionality, there's also this command

grecaptcha.reset(
opt_widget_id
)

Just in case you need to reset captcha, for instance if the person has completed the captcha but still entered in the wrong password. So I'm assuming you'd need to pass that command from the component into the directive? How would do we go about that?

Rob Wormald
@robwormald
in reality i'd probably wrap up most of the captcha stuff into an injectable service
and inject that into your captcha component