【问题标题】:ng-Toast with Angular using $scope'd object/elementsng-Toast 与 Angular 使用 $scope'd 对象/元素
【发布时间】:2017-03-20 18:03:19
【问题描述】:

我无法使用稀疏的 ng-Toast 文档找到此信息。

我有一个设置了 $scope.notifications 的对象列表。我希望这些对象出现在“吐司”中。我设置'$scope.notifications = x;'然后我的 ng-Toast 看起来像这样:

                ngToast.create({
                  content: $scope.notifications,
                  compileContent: true,
                  compileToScope: $scope
                });

但是,我只在出现的 toast 中看到 '[object] [object]。 有什么想法吗?

【问题讨论】:

    标签: javascript angularjs ngtoast


    【解决方案1】:

    答案是'是的,你可以'。

    例子:

                $scope.notifications = x;
                ngToast.create({
                    content: '{{notice.content}}',
                    compileContent: true,
                    compileToScope: $scope
                });
    

    整洁。

    【讨论】:

      猜你喜欢
      • 2016-09-10
      • 2018-02-27
      • 1970-01-01
      • 1970-01-01
      • 2015-12-10
      • 2015-04-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-17
      相关资源
      最近更新 更多