Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
angular-multiple-transclusion
Advanced tools
Simple unobtrusive Angular multiple transclusion support for ng-transclude
ng-transclude
directives within the same AngularJs template.Angular Multiple Transclusion extends ng-transclude
to add support for multiple transclusion.
<div class="panel panel-default">
<div class="panel-heading" ng-transclude transclude-from="header">
</div>
<div class="panel-body" ng-transclude transclude-from="content">
</div>
</div>
http://codepen.io/mcasimir/pen/XbapYd
bower i --save angular-multiple-transclusion
Example task: Create a myPanel
directive transcluding a fragment to the header and a fragment to the body.
Use transclude-from
attribute along with ng-transclude
directive to define insertion points for transclusion:
angular.module('myApp', ['angular-multiple-transclusion'])
.directive('myPanel', function(){
return {
restrict: 'E',
transclude: true,
template:
'<div class="panel panel-default">' +
' <div class="panel-heading" ng-transclude transclude-from="header">' +
' </div>' +
' <div class="panel-body" ng-transclude transclude-from="content">' +
' </div>' +
'</div>'
};
});
Use transclude-to
to wire each element to the respective ng-transclude
block:
<main ng-app="myApp">
<my-panel>
<div transclude-to="header">Hi there!</div>
<div transclude-to="content">Lorem ipsum dolor sit amet...</div>
</my-panel>
</main>
.directive('myDialog', function(){
return {
restrict: 'E',
scope: {
title: '@'
},
transclude: true,
template:
'<div class="dialog">' +
' <div class="dialog-title">{{title}}</div>' +
' <div class="dialog-body" ng-transclude transclude-from="content">' +
' </div>' +
' <div class="dialog-actions" ng-transclude transclude-from="actions">' +
' </div>' +
'</div>'
};
});
<main ng-app="myApp" ng-init="title='My Document'">
<my-dialog title="Save Document">
<div transclude-to="body">Are you sure?</div>
<div transclude-to="actions">
<button>Save {{title}}</button>
</div>
</my-dialog>
</main>
See how people at OpenTable uses multiple transclusion with angular to create reusable components:
FAQs
Simple unobtrusive Angular multiple transclusion support for ng-transclude
We found that angular-multiple-transclusion demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.