javascript - Inserting an image into angularjs table with php -


i have code below on website , want image shown in rows. have tried using tag in variable echoing it, , directly echoing image shows text. there way fix this?

the below snippet shows i'm trying achieve html tag being echoed in shows text when run.

note: below snippet breaks because of php can't run doesn't show issue.

function myctrl($scope) {    $scope.environment_service_packages =       [        {name: 'click expand', info: {text: '<?php  image = "random-image-15.jpg";  $embed = '"<img src=' . '"http://www.spyderonlines.com/image.php?pic=/images/wallpapers/random-image/' . $image . '"' . '>"';    echo "image:"; echo "$embed";  echo "above supposed image @ http://www.spyderonlines.com/image.php?pic=/images/wallpapers/random-image/random-image-15.jpg";    ?>', show: false}},        {name: 'obj2', info: {text: 'some info obj2', show:     false}},      ];  }
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>    <body ng-app>    <table ng-controller="myctrl" class="table table-hover table-striped">      <tr class="info">        <td>...</td>      </tr>      <tbody ng-repeat="x in environment_service_packages">        <tr ng-click="x.info.show = !x.info.show">          <td> {{ x.name }}        </tr>        <tr ng-show="x.info.show">          <td>            {{ x.info.text }}          </td>        </tr>      </tbody>    </table>  </body>


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -