1angular 2 .module("RecebeDigitalSiteApp") 3 .directive("imgUrl", function ($http, $q, $location, config) { 4 return { 5 restrict: "A", 6 require: "ngModel", 7 scope: { 8 s3BaseUrl: "=s3url", 9 object: "=object", 10 lBackground: "=background", 11 fallback: "@?", // opcional 12 }, 13 link: function (scope, elem, attrs, ngModel) { 14 function applyUrl(url) { 15 if (scope.lBackground === "true") { 16 elem.css( 17 "background", 18 `url('${url}') no-repeat center` 19 ); 20 return; 21 } 22 23 // Para <img> 24 elem.attr("src", url); 25 // Para <a> 26 elem.attr("href", url); 27 28 // Se o pai também é clicável 29 if (elem.parent().hasClass("aws-s3-parent")) { 30 elem.parent().attr("href", url); 31 } 32 } 33 34 // 2. Se não tiver cache, busca do backend 35 ngModel.$asyncValidators.imgGenerateURL = function () { 36 const fileFinalUrl = `${scope.s3BaseUrl}${scope.object}`; 37 applyUrl(fileFinalUrl); 38 }; 39 }, 40 }; 41 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.