JSFiddle - React, Tailwind, and code Playground
HTML
<!doctype html>
<html xmlns:ng="http://angularjs.org" xmlns:my="http://localhost/my" ng:app>
<head>
<script src="http://docs-next.angularjs.org/angular-0.10.6.min.js"></script>
</head>
<body>
<h3>Items</h3>
<ul ng:controller="MainCtrl">
<li ng:repeat="item in items">
Item: <my:format item="item"/>
</li>
</ul>
</body>
</html>
JavaScript
function MainCtrl() {
self = this;
this.items = [
{ id: 1, title: 'Foo' },
{ id: 2, title: 'Bar' }
];
}
angular.widget('my:format', function(compileElement) {
return function(linkElement) {
var self = this;
function update() {
var item = linkElement.attr('item');
linkElement.text(self.$eval(item).title);
}
update();
};
});