AngularJS : Access ng-repeat $index inside directive link function to access item in collection -


I have participated in a wall and no document thus far is not helping. I am trying to create an instruction that replaces an element with an iframe pointing to an external resource and every item in my array has a link to its resources

My data looks like this:

  [["title": "launch", "name": "barbells", "resource": $ sce.trustAsResourceUrl (" Http: //external.domain: 14168 / bar / falcon ")}, {" title ":" launch "," name ":" fubar "," resource ": $ Sce.trustAsResourceUrl (" http: // external. Domain: 14168 / Foo / bar ")}];  

My html looks like this:

  & lt; Content element = "talk in things" & gt; & Lt; Iframe ng- src = "{{thing.resource}}" /> & Lt; / Luggage & gt;  

My Director looks like this:

  stuffsModule.directive ('stuffs', function ($ parse) {return {Limited: 'AE', transclue: 'element', replace: right, radius: correct, template: [' ul & gt;', '
  • ,' & lt; (''), Compile: function (Tilement, TATR, transcluse) {var rpt}, iframe / & gt; ',' , '& lt; / ul & gt; = Document.createAttribute ('ng-repeat'); rpt.value = tAttrs element [t] [0]. [0] .attributes.setNamedItem (rpt); return function (area, element, ether) {var rhs = Attr.element.s Plit ('in') [1]; scope.facilities = $ parse (rhs) (scope); var src = document.createAttribute ('ng-src'); src.value = scope.things [area. $ Parent. $ Index] .ourceource; // & lt; = Blown element [0] .children [0] .children [0] .attributes.setNamedItem ();}}}});
  • No matter what I do, scope. $ Parent Assesses $ index to undefined

    Can anyone see the reason why I do not have access to the $ index in the linker function? Should I not be wired by NG-Repeat instructions, which I have added to the collection?

    itemprop = "text">

    There is absolutely no response to your question but please see here I hope this will help you

      app.directive ('stuffs', function ($ parse) {return {restrict:' ACE ',' element ', replace: correct, scope: true, template: ['  ul & gt; 
  • (; '),': ',' , '& lt; / ul & gt;']. Insert (''), compile: function (Tilement, Teater, transcluse ) {Var RPT = Document Content Content Ribut ( "NG-Ripat '); Arpitikvlu = T Attrskliment; Kansolklog (Tiattiars.aliment); Tiielment [0]. Children [0] Kgun KsetNamedItem (Rpt),}};});

  • Comments

    Popular posts from this blog

    java - org.apache.http.ProtocolException: Target host is not specified -

    java - Gradle dependencies: compile project by relative path -

    ruby on rails - Object doesn't support #inspect when used with .include -