Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-multi-transclude

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-multi-transclude

Simple unobtrusive Angular multiple transclusion support for ng-transclude

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-54.32%
Maintainers
1
Weekly downloads
 
Created
Source

angular-multi-transclude

Simple unobtrusive Angular multiple transclusion support for ng-transclude

Install

bower i --save angular-multi-transclude

Usage

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 transclusion slots:

angular.module('myApp', ['angular-multi-transclude'])

.directive('myPanel', function(){
  return {
    restrict: 'E',
    transclude: true,
    scope: 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>

Keywords

FAQs

Package last updated on 15 Jun 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc