1

我正在使用 facebook 标签。只有当页面嵌入到 iframe 中时,它才会在 http-response 中收到某些 iframe 帖子。这意味着我不能像往常一样使用 $http。我试图弄清楚如何将这些数据提供给 angular。

我试过这个,但它不起作用。

        <?php 
            if($signed_request['page']['liked'] == 1){
                echo '<script type="text/javascript">$scope.liking = true</script>';
            }else{
                echo '<script type="text/javascript">$scope.liking = false</script>';
            }
?>

我考虑过添加某种 html 字段,例如附加了 ng-model 的输入 type="hidden",但感觉有点 hacky。角度是否有解决此类问题的建议方法?

4

0 回答 0