0

私はこれのために壁に向かって頭を叩いています:

ビューテンプレートでコントローラーから動的に生成されたビュー変数の値を設定したい:

<div ng-repeat="(key,value) in educations" >
    <p ng-click="loadEducation(value)">Dynamically add html to the below <div> </p>
    <div ng-bind-html="eduiframe_value[ID]"></div>
</div>

私のコントローラーで:

関数 :

    module.controller('listeducations',function($scope,$http,$rootScope,$cookies,ServiceEducation){
    /*
    service below will set the view variable educations
    each object contains the following :
    $$hashKey: "object:132"
    ID: "440"
    title: "HIPPA_SERVER_CONFIGURATION_1.pdf"
path : "http://stackoverflow.com/"
    */
     ServiceEducation.getEducations($scope);

     /*Open a education item in the iFrame*/
    $scope.loadEducation = function(obj){
        var p = 'eduiframe_'+obj.ID;
        $scope.p = '<iframe src='+obj.path+' >'; //but this is not working
    }

    });

説明 : iFrame を個々の div 要素に挿入したいと考えています。

誰でもこれを行う方法を知っていますか?

4

0 に答える 0