ng-Toast with Angular using $scope'd object/elements

216 Views Asked by At

I haven't been able to find this information using the sparse ng-Toast documentation.

I have a list of objects that I set a $scope.notifications to. I would like these objects to appear in the 'toast'. I set '$scope.notifications = x;' and then my ng-Toast looks like this:

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

However, I only see '[object] [object] in the toast that appears. Any ideas?

1

There are 1 best solutions below

0
On

The answer is 'yes you can'.

Example:

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

Neat.