question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Ability to Apply Directives

See original GitHub issue

First off, thank you for this package, it is great.

It would be great to have the ability to apply other directives to the component and have them then applied to the <img/> element. For example I am also using this package in my project. In order to apply it to an image element the markup would look something like:

<img-loader [src]="map" useImg [spinner]="false" imageViewer></img-loader>

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tabirkelandcommented, Apr 19, 2017

@ihadeed thank you!

1reaction
ihadeedcommented, Feb 7, 2017

I’m able to apply the attributes to the child element, but Angular doesn’t use them as a directive. I think the directive needs to be defined in compile time.

Attaching an attribute dynamically won’t register it as a directive.

The following is possible but I need to test it to make sure it works:

HTML code will look as follows:

<img [imageSrc]="https://path/to/image.png" imageLoader imageViewer />

Then in the TypeScript code, I can host the click event and call stopPropagation if the image is not loaded yet. This should stop any click event handlers from functioning. I’m just not sure if it has any effect on the imageViewer event handler, or if it would run before the imageViewer handler runs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ability to use !include directives in UI editor - Feature Requests
In particular, I would love to be able to use the !include directive in my dashboards! I've got a few integrations that auto-generate...
Read more >
Need ability to add directives to host elements in component ...
In the the following example, I have a button component, and a directive that will apply styles based on touch events. T...
Read more >
Send a Gadget a Custom Directive from a Skill | Alexa ...
If you want to trigger Alexa Gadget behaviors from a custom skill, you can do that by sending one or more custom directives...
Read more >
GraphQL directives are underrated - LogRocket Blog
Simply put, a directive is a function that augments some other functionality. It is defined using the @ symbol. For instance, in the...
Read more >
mod_authz_core - Apache HTTP Server Version 2.4
The alias providers can then be referenced through the Require directive in the same way as a base authorization provider. Besides the ability...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found