无法在视图中打开iframe

时间:2016-07-02 06:49:25

标签: javascript html angularjs iframe

我有一个场景,我需要在点击候选简历链接时在iframe中打开候选简历 这是我的HTML:

<div ng-class="{'col-xs-6': myVar=='something'}">
<div class="panel panel-default panel-height" ng-repeat="candidateInfo in aCandidateDetails track by $index">
    <div class="panel-heading header-background">
        <div stop-watch time="xyz" name="candidateInfo.name" time-of-interview="candidateInfo.doi" class="stop-watch"></div>
        <div class="row">
            <div class="col-xs-2"><a style="cursor:pointer" class="pull-right">{{candidateInfo.name}}</a></div>
            <div class="col-xs-offset-9"><a href="http://192.168.208.32:4000/{{candidateInfo.filepath}}" target="iframe_a" style="cursor:pointer" ng-click="fnVar(candidateInfo.name)" data-toggle="collapse" data-target="{{'#'+toggle}}">{{candidateInfo.name}} resume</a></div>
        </div>
    </div>
</div>

<div id="{{toggle}}" class="collapse" ng-class="{'col-xs-6': myVar=='something'}">
<iframe name="{{toggle}}"></iframe>

一个控制器代码,我有简单的ajax调用和切换逻辑

angular.module('hrPortalApp')
.controller('candidateInterviewCtrl', function($scope, $state, iterateArray, getCandidateInterviewListService) {
    getCandidateInterviewListService.fnGetCandidateDetails("xyz").then(function(response) {
        $scope.aCandidateDetails = response;
        console.log(response);
        $scope.toggle = "accor"

    });
    $scope.fnVar = function(name) {
        $scope.checkVar = !$scope.checkVar;
        if ($scope.checkVar) {
            $scope.myVar = "something";
        } else {
            $scope.myVar = false;
        }
    }
});

我不知道我哪里出错,但这个iframe没有被触发

任何帮助都将不胜感激。

0 个答案:

没有答案