Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

128
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda