Angular: Empty Fiddle
http://angularjs.org/
HTML
<script src="https://code.angularjs.org/1.2.7/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.0-beta.3/angular-sanitize.min.js"></script>
<div ng-controller="myCtrl">
Stages,
<p ng-repeat="stage in stages">{{stage}}</p>
<hr/>
Plant stages
<plant-stages
title="<b>Final Try</b>"
stages="stages"
>Exploration<br/>du cycle</plant-stages>
</div>
CSS
.cornStages {
border: solid 1px red;
width: 100%;
height: 100%;
}
JavaScript
var app = angular.module('myApp',['ngSanitize']);
app.directive('plantStages', function () {
return {
restrict: 'E',
transclude: true,
template: '<figure class="cornStages"><p ng-transclude></p><div ng-bind-html="title"></div><p ng-repeat="stage in stages">{{stage}}</p></figure>',
scope: {
stages:"=",
title:'@'
},
link: function (scope, element, attrs) {
//scope.title = attrs.title;
}
};
});
//app.directive('myDirective', function() {});
//app.factory('myService', function() {});
app.controller('myCtrl', function ($scope, $location, $http) {
$scope.stages = ['floraison', 'montaison'];
});