Skip to content

Instantly share code, notes, and snippets.

@wwwmarcos
Created July 17, 2017 04:37
Show Gist options
  • Save wwwmarcos/360d41652d5be6f6c4f371923f5a0b42 to your computer and use it in GitHub Desktop.
Save wwwmarcos/360d41652d5be6f6c4f371923f5a0b42 to your computer and use it in GitHub Desktop.
(function() {
'use strict'
angular
.module('alabama', [])
.component('alabama', {
template: 'transclude.component.html',
controller: AlabamaComponentController,
transclude: {
'title': '?alabamaTitle',
'body': 'alabamaBody',
}
})
function AlabamaComponentController() {
var $ctrl = this
}
})()
<alabama>
<alabama-title>
Wow, title
</alabama-title>
<alabama-body>
Lorem ipsum dolor
</alabama-body>
</alabama>
<div data-ng-transclude="title">
<h1>Fallback Title</h1>
</div>
<div data-ng-transclude="body" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment