This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<foo> | |
<bar> | |
<bash></bash> | |
</bar> | |
</foo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container-fluid"> | |
<div class="row"> | |
<div class="col-sm-12"> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-sm-6"> | |
<p>Nunc congue, enim nec faucibus rutrum, orci magna bibendum odio, nec euismod lectus neque at felis. Vestibulum lectus arcu, aliquet vel vulputate sed, aliquet convallis massa. Aenean urna ante, pretium in pellentesque at, posuere vitae urna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec in ipsum urna, id aliquet erat. Aliquam id nisi eu nunc pulvinar faucibus quis quis erat. Aliquam placerat auctor lectus, sit amet consectetur ipsum lacinia sit amet.</p> | |
<p>Duis vulputate bibendum elementum. Phasellus eu sodales ligula. Vivamus at justo mauris, id pretium libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Maecenas hendrerit dolor sit amet urna lacinia porttitor. Integer sed gr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="someParent"> | |
<div ng-include="resource.contentType"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ contentType: 'application/vnd.endjin.test.greeting', content: { greeting: 'hello', greet: 'world' } } | |
{ contentType: 'application/vnd.endjin.test.salutation', content: { salutation: 'hail', greet: 'caesar' } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="GreetingController"> | |
<p><span ng-bind="content.greeting"></span> <span ng-bind="content.greet"></span></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div ng-controller="SalutationController"> | |
<p><span ng-bind="content.salutation"></span> <span ng-bind="content.greet"></span></p> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.translateContentTypeToUri = function(contentType) { | |
return '/api/views/' + encodeURIComponent(contentType); | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="someParent"> | |
<div ng-include="translateContentTypeToUri(resource.contentType)"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.config(["$provide", function ($provide) { | |
$provide.decorator("$templateCache", ["$delegate", "templateRepository", function ($delegate, templateRepository) { | |
// Stash away the original get method | |
var origGetMethod = $delegate.get; | |
// Replace it with our getter | |
$delegate.get = function (url) { | |
// Do we match our content type family prefix? | |
var prefix = 'application/vnd.endjin.test'; | |
if (url.slice(0, prefix.length) == prefix) { | |
return templateRepository.getTemplate(url); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.factory('templateRepository', [ '$injector', function($injector) { | |
function lookupUrlFor(contentType) { | |
// Do your translation here | |
} | |
return { | |
getTemplate: function(contentType) { | |
var templateCache = $injector.get('$templateCache'); | |
return templateCache.get(lookupUrlFor(contentType)); | |
} |
OlderNewer