Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Angular js adding attribute directive from another directive

Pretend I have this: <span ng-bind="value" my-dir my-dir-param="value"></span> So my-dir is a custom directive that adds another directive to an existing element. I guess it gonna look like this (skipping everything except some props from dir. def. object:

...
priority: 1001,
terminal: true
compile: function(el, attrs) {
 attrs.$set("some_directive", "placeholder_text");
 var compiled = $compile(el, null, 1001);
 return function linkFn(scope, el, attrs) {
  compiled(scope)
  ...some extra logic here...
}
}
...

I've tried to do such away and the problem is that ng-bind will bind on value from the directive scope, not the outer scope. I don't want to affect scopes from which other directives absorb values. What I want is that by adding my-dir directive I will apply "some_directive" and that won't affect the values that other directives receive. Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!