René's URL Explorer Experiment


Title: Feature Request: Programmatically add directives to another directive's elements before they get compiled. · Issue #6950 · angular/angular.js · GitHub

Open Graph Title: Feature Request: Programmatically add directives to another directive's elements before they get compiled. · Issue #6950 · angular/angular.js

X Title: Feature Request: Programmatically add directives to another directive's elements before they get compiled. · Issue #6950 · angular/angular.js

Description: I ran into an issue. So far as I know, Angular doesn't have a mechanism by which to address it easily. http://ngmodules.org has some awesome modules. They are really easy to use, but if they don't expose any events to you, then you're ou...

Open Graph Description: I ran into an issue. So far as I know, Angular doesn't have a mechanism by which to address it easily. http://ngmodules.org has some awesome modules. They are really easy to use, but if they don't ...

X Description: I ran into an issue. So far as I know, Angular doesn't have a mechanism by which to address it easily. http://ngmodules.org has some awesome modules. They are really easy to use, but if they do...

Opengraph URL: https://github.com/angular/angular.js/issues/6950

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.112.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Programmatically add directives to another directive's elements before they get compiled.","articleBody":"I ran into an issue. So far as I know, Angular doesn't have a mechanism by which to address it easily.\n\nhttp://ngmodules.org has some awesome modules. They are really easy to use, but if they don't expose any events to you, then you're out of luck if you don't want to actually modify the 3rd party module's source code.\n\nWhat if Angular had an easy way to attach directives to the element of another directive `programmatically` (before it and any sub-templates get compiled) so that one could use third party directives and not worry if they've exposed any useful features like like event handling mechanism (e.g. they don't use ngClick on any elements)?\n\nFor example, here's an example:\n\nSuppose we use someone's `awesomeDirective`.\n\n``` html\n\u003cdiv data-awesome-directive=\"awesome.data\">\u003c/div>\n```\n\nThis nice directive generates some type of awesome HTML widget with HTML that is defined in the 3rd party source code, perhaps a twitter feed, a profile badge, or something else awesome, but the author of the directive did not include any way to handle click events, etc!\n\nWe could step away from Angular, and use jQuery to make a click handler like\n\n``` javascript\n$(\"#awesomeWidget\").on(\"click\", function() {/* ... */});\n```\n\nbut we don't want to leave the world of Angular awesomeness!\n\nPerhaps, a new addition to the `Module.directive` API can be added to Angular so one can add a directive to any other directive's elements, like so:\n\n``` javascript\nangular.element(document).ready(function() {\n\n    // create your app with a dependency on a 3rd party module.\n    var myApp = angular.module(\"myApp\", [\"awesomeModuleContainingAwesomeDirective\"]);\n\n    // the 3rd party module contains an awesomeDirective.\n\n    // create a custom directive:\n    myApp.directive(\"customDirective\", function() {\n            return { // set up directive properties like normal.\n                restrict: \"A\",\n                scope: {/* ... */},\n                // etc...\n            };\n        });\n\n    // attach the custom directive to the elements of another directive:\n    myApp.directive(\"awesomeDirective\") // get the directive.\n        .attachDirective(\".elements\", \"customDirective\");\n\n    // the first argument to attachDirective() is a standard jQuery selector.\n    // internally, Angular would use jQuery's .find(\".element\")\n\n    // add an already-existing directive  to the elements of another directive:\n    var awesomeDirective = myApp.directive(\"awesomeDirective\"); // gets the directive.\n    awesomeDirective.attachDirective(\".otherElements\", \"ngCloak\");\n\n    // use a third argument for directives that accept an attribute expression:\n    awesomeDirective.attachDirective(\"#oneElement\", \"ngClick\", \"count = count + 1\");\n\n    angular.bootstrap(document, [\"myApp\"]);\n\n    /*\n     * This would be absolutely pure awesome.\n     */\n});\n```\n\nThis would be a nice way to extend directives that you are using in your app... But what if you want to attach directives to only specific instances of another directive? Then:\n\n``` javascript\n    myApp.directive(\"awesomeDirective\") // gets the directive.\n        .attachDirective([\".rootElements\", \".elements\"], 'ngClick', \"count = count + 1\");\n    // ^ still no more than 3 arguments\n```\n\nThe first argument in this case is an array. The first element in the array tells Angular that we wish to attach our directive to elements matching the `awesomeDirective` only if those elements are `.rootElements`. All `.rootElements` that match the `awesomeDirective` will then have the `ngClick` directive applied to sub elements of the class `elements` using jQuery's `.find('.elements')`.\n\nAngular could benefit from something like this! And it would not only be useful for event handling that 3rd party modules haven't exposed, but for augmenting 3rd party directives with all sorts of other functionality.\n","author":{"url":"https://github.com/trusktr","@type":"Person","name":"trusktr"},"datePublished":"2014-04-02T08:35:05Z","url":"https://github.com/angular/angular.js/issues/6950"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:86256eac-c021-07cb-c283-fe07b002cc70
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD2B0:1E6AC8:223D22:307B18:6B0468AC
html-safe-noncee2c2afaee481c52835aaa281905145283d85f6eda741598d548fa4883454e3ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkIwOjFFNkFDODoyMjNEMjI6MzA3QjE4OjZCMDQ2OEFDIiwidmlzaXRvcl9pZCI6IjU4MDExMDUzNzA5MzIwNzg3NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac0b77c996a5b843f86df928cb7f1f0f40e048f8d89a63f9931b128dc246a43b90
hovercard-subject-tagissue:30668395
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular.js/6950/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8b9068adfb7d6a9bc9f9e008d4779544de7bfa77ae0b93a095ec0e134abbe9db/angular/angular.js/issues/6950
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8b9068adfb7d6a9bc9f9e008d4779544de7bfa77ae0b93a095ec0e134abbe9db/angular/angular.js/issues/6950
og:image:altI ran into an issue. So far as I know, Angular doesn't have a mechanism by which to address it easily. http://ngmodules.org has some awesome modules. They are really easy to use, but if they don't ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametrusktr
hostnamegithub.com
expected-hostnamegithub.com
None83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f
turbo-cache-controlno-preview
go-importgithub.com/angular/angular.js git https://github.com/angular/angular.js.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id460078
octolytics-dimension-repository_nwoangular/angular.js
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id460078
octolytics-dimension-repository_network_root_nwoangular/angular.js
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseca4d07a7cef4e4b75f821dc25e7300d80c1450a9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular.js/issues/6950#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular.js%2Fissues%2F6950
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular.js%2Fissues%2F6950
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular.js
Reloadhttps://github.com/angular/angular.js/issues/6950
Reloadhttps://github.com/angular/angular.js/issues/6950
Reloadhttps://github.com/angular/angular.js/issues/6950
angularhttps://github.com/angular
angular.jshttps://github.com/angular/angular.js
Codehttps://github.com/angular/angular.js
Issues389 (389)https://github.com/angular/angular.js/issues
Pull requests72 (72)https://github.com/angular/angular.js/pulls
Actionshttps://github.com/angular/angular.js/actions
Projectshttps://github.com/angular/angular.js/projects
Wikihttps://github.com/angular/angular.js/wiki
Security and qualityhttps://github.com/angular/angular.js/security
Insightshttps://github.com/angular/angular.js/insights
https://github.com/angular/angular.js
Feature Request: Programmatically add directives to another directive's elements before they get compiled.https://github.com/angular/angular.js/issues/6950#top
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issue-30668395
http://ngmodules.orghttp://ngmodules.org
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39336518
#6781https://github.com/angular/angular.js/pull/6781
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39379579
@trusktrhttps://github.com/trusktr
http://docs.angularjs.org/api/auto/object/$providehttp://docs.angularjs.org/api/auto/object/$provide
#6781https://github.com/angular/angular.js/pull/6781
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39379623
design dochttps://docs.google.com/documentd/1f5VWROeTI2kJwVKbNsrHuEz5IqtZe14OpoxM9fEYJNU/mobilebasic?pli=1
#6781https://github.com/angular/angular.js/pull/6781
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39383020
@lgalfasohttps://github.com/lgalfaso
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Apr 2, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39397847
http://docs.angularjs.org/api/ng/service/$compilehttp://docs.angularjs.org/api/ng/service/$compile
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Apr 3, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39413620
@lgalfasohttps://github.com/lgalfaso
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Apr 3, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39454435
@trusktrhttps://github.com/trusktr
lgalfasohttps://github.com/lgalfaso
completedhttps://github.com/angular/angular.js/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 3, 2014https://github.com/angular/angular.js/issues/6950#event-108318519
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Apr 5, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39628826
@lgalfasohttps://github.com/lgalfaso
not well documentedhttp://docs.angularjs.org/api/auto/object/$provide#decorator
herehttp://angular-tips.com/blog/2013/09/experiment-decorating-directives/
Some way to conditionally apply directives #5524https://github.com/angular/angular.js/issues/5524
http://stackoverflow.com/questions/15279244/dynamically-add-directives-on-angularjshttp://stackoverflow.com/questions/15279244/dynamically-add-directives-on-angularjs
http://stackoverflow.com/questions/13459705/dynamically-adding-angularjs-directiveshttp://stackoverflow.com/questions/13459705/dynamically-adding-angularjs-directives
http://stackoverflow.com/questions/16184557/how-to-dynamically-add-a-custom-directive-to-a-div-elementhttp://stackoverflow.com/questions/16184557/how-to-dynamically-add-a-custom-directive-to-a-div-element
http://stackoverflow.com/questions/16656735/insert-directive-programatically-angularhttp://stackoverflow.com/questions/16656735/insert-directive-programatically-angular
https://groups.google.com/forum/#!msg/angular/an9QpzqIYiM/r8v-3W1X5vcJhttps://groups.google.com/forum/#!msg/angular/an9QpzqIYiM/r8v-3W1X5vcJ
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Apr 5, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-39651320
#6950 (comment)https://github.com/angular/angular.js/issues/6950#issuecomment-39336518
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Oct 17, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-59473591
@lgalfasohttps://github.com/lgalfaso
https://github.com/lgalfaso
lgalfasohttps://github.com/lgalfaso
on Oct 20, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-59837690
@trusktrhttps://github.com/trusktr
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Oct 20, 2014https://github.com/angular/angular.js/issues/6950#issuecomment-59842883
@lgalfasohttps://github.com/lgalfaso
https://github.com/mustaphakd
mustaphakdhttps://github.com/mustaphakd
on Mar 1, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76628935
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Mar 1, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76638627
@mustaphakdhttps://github.com/mustaphakd
@davideasthttps://github.com/davideast
https://github.com/trusktr
trusktrhttps://github.com/trusktr
on Mar 1, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76639173
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Mar 2, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76683535
@lgalfasohttps://github.com/lgalfaso
https://github.com/mustaphakd
mustaphakdhttps://github.com/mustaphakd
on Mar 3, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76944196
@gkalpakhttps://github.com/gkalpak
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Mar 3, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76945655
@mustaphakdhttps://github.com/mustaphakd
https://github.com/mustaphakd
mustaphakdhttps://github.com/mustaphakd
on Mar 3, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76949623
@gkalpakhttps://github.com/gkalpak
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Mar 3, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76954634
@mustaphakdhttps://github.com/mustaphakd
appropriate channelshttps://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#question
https://github.com/mustaphakd
mustaphakdhttps://github.com/mustaphakd
on Mar 3, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-76957050
@gkalpakhttps://github.com/gkalpak
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Mar 4, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-77124082
@mustaphakdhttps://github.com/mustaphakd
https://github.com/mustaphakd
mustaphakdhttps://github.com/mustaphakd
on Mar 4, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-77125539
@gkalpakhttps://github.com/gkalpak
https://github.com/schmod
schmodhttps://github.com/schmod
on Mar 4, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-77267963
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Mar 5, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-77325634
@schmodhttps://github.com/schmod
https://github.com/mike-marcacci
mike-marcaccihttps://github.com/mike-marcacci
on Apr 5, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-89730346
@trusktrhttps://github.com/trusktr
clever post on SOhttp://stackoverflow.com/questions/19224028/add-directives-from-directive-in-angularjs#answer-19228302
https://github.com/davincho
davinchohttps://github.com/davincho
on Jun 7, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-109731756
https://github.com/mikekhaas
mikekhaashttps://github.com/mikekhaas
on Sep 11, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-139577602
https://github.com/murli2308
murli2308https://github.com/murli2308
on Dec 15, 2015https://github.com/angular/angular.js/issues/6950#issuecomment-164779171
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular.js/issues/6950
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular.js/issues/6950
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.