Questions tagged [angularjs-ng-transclude]

Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.

From Angularjs documentation:

Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.

208 questions
0
votes
2 answers

How can I achieve component composition in AngularJS (similar to React render props pattern)?

I am trying to create a grid component in AngularJS that has it's grid items provided at runtime. (think render props pattern in React). I am trying to build this using the "new" AngularJS components API along with transclusion.
0
votes
1 answer

AngularJS Transcluded directive's scope catch from other Directive

I got transcluded directive, for example 'aDirective' and other random 'bDirective' directive. My task is: I want to get a 'aDirective's scope variable and catch it in 'bDirective'. angular.module('myApp',[]) …
0
votes
0 answers

Get transclude slot from nested child in angularjs

I have a multi-transclude directive with two slots: myModule.directive('myDirective', function () { return { restrict: 'E', templateUrl: 'myTemplate.html', transclude: { 'slot1': 'slot1', 'slot2':…
Arashsoft
  • 2,749
  • 5
  • 35
  • 58
0
votes
1 answer

AngularJS 1.6.x Component Transclude Scope Issue

How to do get access to the parent binding in my child transclude usage? Parent Component:
0
votes
1 answer

Toggle with ng-show not working in directive

I have directive that brings up the sidebar in my application. I tried to write some code to toggle some content inside this sidebar. But when I trigger the toggle function nothing happens. This is my directive: menuItem.directive("menuItem",…
0
votes
1 answer

Adding an attribute to a transcluded element

I have a form directive that extends the ability of HTML form tag that I maintain to add behaviours to it . Given below is one use of it , return { restrict: 'E', replace: true, transclude: 'element', template:…
32teeths
  • 1,469
  • 1
  • 15
  • 32
0
votes
0 answers

Add ngAttribute to transcluded content

If I have a directive that has transcluded content passed to it:
and the directive has its own template:
0
votes
1 answer

Using template from 1 directive into another directives template

Basically I have 2 custom directives, each having it's own template. What I need is to insert one of the templates into the other. I have also read about transclusion, but can't wrap my head around it. Any ideas would be of great help!
0
votes
0 answers

Multiple directives [directive2, directive1] asking for transclusion

I encountered this error when trying to move clutter away into a directive. function Ctrl($scope, $rootScope) { } angular.module('app', []); angular .module('app') .directive('directive1', Directive1); function…
droidbot
  • 937
  • 1
  • 10
  • 26
0
votes
1 answer

Angular - ng-click function on transcluded directive content is not triggered

I have two directives, parent directive should simply wrap around its child. The transclusion is used for this purpose. However, then any other directive, such as ng-click, bound to the child directive element as its attribute does not work (is it…
0
votes
1 answer

Use ng-transclude more than once in same component

I'm building a container, which has a header and a content. I can toggle the container by clicking on the header and show my content stuff. In my header there are also some informations, that are visible in every toggle state. It looks like…
webta.st.ic
  • 4,781
  • 6
  • 48
  • 98
0
votes
2 answers

Add DOM element when transcluding except for the last one child

I would like to add a
element between each clone of my transclude function except for the last one clone. The parent directive have a custom HTML template. In this template, I call a Attribute directive to transclude the elements. …
0
votes
2 answers

How can I render compiled Transcluded HTML in Angular?

I am trying to render html that represents a custom directive using angular so that I nest divs an arbitrary number of times. When I run the below code I do see the tag properly transcluded and the browser in my output shows literally the string…
0
votes
2 answers

ng-repeat got more and more element when used in ng-transclude and toggled by ng-if

Here is my full test code: