René's URL Explorer Experiment


Title: Add node processing hook to $compile public API. · Issue #15270 · angular/angular.js · GitHub

Open Graph Title: Add node processing hook to $compile public API. · Issue #15270 · angular/angular.js

X Title: Add node processing hook to $compile public API. · Issue #15270 · angular/angular.js

Description: Do you want to request a feature or report a bug? Feature What is the current behavior? I have no way of modifying a node before the majority of compile functionality takes place (that I've found, and yes, I've read the source :) ). Supp...

Open Graph Description: Do you want to request a feature or report a bug? Feature What is the current behavior? I have no way of modifying a node before the majority of compile functionality takes place (that I've found, ...

X Description: Do you want to request a feature or report a bug? Feature What is the current behavior? I have no way of modifying a node before the majority of compile functionality takes place (that I've fou...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add node processing hook to $compile public API.","articleBody":"**Do you want to request a _feature_ or report a _bug_?**\n\nFeature\n\n**What is the current behavior?**\n\nI have no way of modifying a node before the majority of compile functionality takes place (that I've found, and yes, I've read the source :) ).\n\nSuppose I want all components named `mySubmenu` to also have the directive `genericStateListener` applied to them. I've separated out a lot of ui-router state based functionality into it's own directive, in keeping with the separation of concerns principle. I don't want a bunch of generic state handling logic clogging up my component controller. Additionally, I may want to use this state logic on other components that are concerned with state transitions.\n\nWell, to do this, I have two options (that I know of):\n\n1) I could place the directive `genericStateListener` in every place I use `mySubmenu`. Well, that's annoying :)\n2) I could wrap my template for `mySubmenu` in a block which has the `genericStateListener` directive. This is workable, but it bothers me that someone else viewing my code needs to go into my template to understand that this component has state listening functionality. Additionally, if I want to interact with the `genericStateListener` directive controller, I cannot require it, because it's BELOW me now.\n\nNow the situation becomes even MORE complex (but also more simple) in the instance that, perhaps I don't want to be tied to a particular functionality/directive for listening to states. I want to abstract it further. In fact, I just want to be able to put an `isStateListener` field on my component. Then, by overriding the `.component` decorator, I can add an annotated field `$stateListener` every time I see this field on my `options` object. GREAT I now have a way to check if the user wants to have stateListener functionality on the component I'm compiling! These are the kinds of things I can EASILY do already in angular's current state. There's only one problem, even once I get said attribute on the final directive object... I can't do anything with it.\n\nThere's no way of modifying a node prior to the start of the compilation process (before directives are collected). By the time I can add functionality to the $compile process, directives have already been collected. This seriously hampers extensibility of the component object.\n\n**What is the expected behavior?**\n\nI would expect there to be a publicly accessible function to be run somewhere in the `collectDirective` function, like this:\n\n```\n  switch (nodeType) {\n        case NODE_TYPE_ELEMENT: /* Element */\n          // use the node name: \u003cdirective>\n          runNodeTransforms(nodeName_(node),node); // function exposed on $compileProvider\n          addDirective(directives,\n              directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);\n\n          // iterate over the attributes\n          for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,\n                   j = 0, jj = nAttrs && nAttrs.length; j \u003c jj; j++) {\n            var attrStartName = false;\n            var attrEndName = false;\n\n```\n\nThis would enable me to implement so much additional functionality in a clean, concise, and for the sake of other developers on my project, abstractly. For example, suppose I'm using https://github.com/tenphi/angular-bem, and I want all components to also have a block\ndirective on them for simple, clean BEM notation. I could just do this:\n\n```\nfunction componentDecoratorConfig($compileProvider) {\n        \"ngInject\";\n        var oldProvider = $compileProvider.$get,\n            oldComponent = $compileProvider.component;\n\n        $compileProvider.component = registerComponent;\n\n        function registerComponent(name, options) {\n            options.$isComponent = true;\n            return oldComponent.bind($compileProvider)(name, options);\n        }\n\n       $compileProvider.addNodeTransform(function(name, node) {\n            if($injector.has(name + 'Directive') \n                && $injector.get(name + 'Directive').controller.$isComponent) {\n                node.attr.set('block', name);\n            }\n            return node;\n        });\n```\n\nAnd voila! It's done! I'll admit that there are some parts of the compilation process that I don't fully get, and maybe this will have unintended consequences that I don't understand, but it seems like a simple solution to a problem that provides extensibility that is more generic that traditional specific directive decorators.\n\nThere was a similar pull request done by @lgalfaso , here: https://github.com/angular/angular.js/pull/6781, it seemed to have gotten some good feedback, but it was pretty involved, and it looks like it got shelved.\n\nI'd be glad to create a pull request, if I thought this functionality had any chance of being merged.\n\n-Aaron\n","author":{"url":"https://github.com/Aaron-Pool","@type":"Person","name":"Aaron-Pool"},"datePublished":"2016-10-14T16:22:17Z","url":"https://github.com/angular/angular.js/issues/15270"}

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:1ae13b15-73d4-d59a-5aa3-3698f3ba2ffe
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD9DC:12ECEE:45905D:603117:6B047091
html-safe-nonceeca2b24c3552dccdcd6b3bd0477e9e7223a177c7968a020e01814a503bd51270
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOURDOjEyRUNFRTo0NTkwNUQ6NjAzMTE3OjZCMDQ3MDkxIiwidmlzaXRvcl9pZCI6Ijk0MTA1OTUyMTgxMzE3Nzc3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1c0ea7132ac203ba6ce402ad097c743d06992542efeef2d594f5987bbfad7ebe
hovercard-subject-tagissue:183092650
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/15270/issue_layout
twitter:imagehttps://opengraph.githubassets.com/27a9671e7a773ab19545eb144e33aa112dbc394e90b275d2a26b3535568307f1/angular/angular.js/issues/15270
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/27a9671e7a773ab19545eb144e33aa112dbc394e90b275d2a26b3535568307f1/angular/angular.js/issues/15270
og:image:altDo you want to request a feature or report a bug? Feature What is the current behavior? I have no way of modifying a node before the majority of compile functionality takes place (that I've found, ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAaron-Pool
hostnamegithub.com
expected-hostnamegithub.com
Noneae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f
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
releasecfb5f24c6e01d85f70804652a5107e5cac03a161
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular.js/issues/15270#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular.js%2Fissues%2F15270
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%2F15270
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/15270
Reloadhttps://github.com/angular/angular.js/issues/15270
Reloadhttps://github.com/angular/angular.js/issues/15270
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
Add node processing hook to $compile public API.https://github.com/angular/angular.js/issues/15270#top
component: $compilehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20%24compile%22
frequency: lowhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22frequency%3A%20low%22
severity: confusinghttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22severity%3A%20confusing%22
type: featurehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
Backlog - won't fixhttps://github.com/angular/angular.js/milestone/27
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issue-183092650
https://github.com/tenphi/angular-bemhttps://github.com/tenphi/angular-bem
@lgalfasohttps://github.com/lgalfaso
#6781https://github.com/angular/angular.js/pull/6781
gkalpakhttps://github.com/gkalpak
component: $compilehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20%24compile%22
type: featurehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
frequency: lowhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22frequency%3A%20low%22
severity: confusinghttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22severity%3A%20confusing%22
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#event-824443826
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253900234
#6781https://github.com/angular/angular.js/pull/6781
Demohttps://codepen.io/ExpertSystem/pen/RGBJqR?editors=0011
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253903953
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253916596
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253923821
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253923963
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 14, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253931827
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 15, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253955362
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 15, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-253976716
gkalpakhttps://github.com/gkalpak
Purgatoryhttps://github.com/angular/angular.js/milestone/35
1.5.xhttps://github.com/angular/angular.js/milestone/90
on Oct 15, 2016https://github.com/angular/angular.js/issues/15270#event-824856517
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 15, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-254016016
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 16, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-254019233
angular/angular#8785https://github.com/angular/angular/issues/8785
gkalpakhttps://github.com/gkalpak
on Oct 18, 2016https://github.com/angular/angular.js/issues/15270#event-827374472
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 20, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-255168775
@gkalpakhttps://github.com/gkalpak
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Oct 20, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-255173184
@Aaron-Poolhttps://github.com/Aaron-Pool
angular/angular#8785https://github.com/angular/angular/issues/8785
https://github.com/Aaron-Pool
Aaron-Poolhttps://github.com/Aaron-Pool
on Oct 20, 2016https://github.com/angular/angular.js/issues/15270#issuecomment-255173828
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular.js/issues/15270
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular.js/issues/15270
component: $compilehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22component%3A%20%24compile%22
frequency: lowhttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22frequency%3A%20low%22
severity: confusinghttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22severity%3A%20confusing%22
type: featurehttps://github.com/angular/angular.js/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
Backlog - won't fixNo due datehttps://github.com/angular/angular.js/milestone/27
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.