angularjs - Use ng-bind-html-unsafe with expression containing brackets -
for angular render expression in template has hyphen property name brackets must used instead of dot. example docs["paragraph-content"] instead of docs.paragraph-content. trying print variable inside ng-bind-html-unsafe ng-bind-html-unsafe="doc["paragraph-content"]" inside directive template getting syntax error , error: syntax error: token 'undefined' not primary expression @ column nan of expression [doc[] starting @ [doc[].
template: '<div>' + '<input ng-model="query" placeholder="check face" name="search"></input>' + '<h2 id="search-list-title" class="list-header-title">search results {{query}}</h2>' + '<form id="search-list-form" class="list-row list-form" ng-repeat="doc in results.docs">' + ' <a id="search-item-title" class="list-element list-title" href="retrieve-graph?id={{doc.id}}"><p>{{doc["paragraph-subject"]}}</p></a>' + ' <p id="search-item-content" class= "list-element list-content" ng-bind-html-unsafe="doc["paragraph-content"]"></p>' + ' <p id="search-item-id" class= "list-email list-element">{{doc["user-email"]}}</p>' + ' <!--<p>{{doc.title}}</p>-->' + ' <!--urls point user paragraph list , goes specific paragraph through anchor link' + ' <!--need create form inserts id parameter can query , display on template page <p><a target="_blank" href="{{doc.id}}"> {{doc.url}}</a></p>-->' + ' <br>'+ '</form>'+ '</div>' ,
Comments
Post a Comment