javascript - Angular: Render externalized strings containing scope variables in the controller -
is possible render externalized strings (passed server in case) in controller?
my use case: i'm using angular-toastr alert service, , must pass message , title toastr object. tricky part when strings contain scope variables, e.g: stringfromserver = "something {{somevariable}} went wrong"
.
i know in http callback somevariable
want render string before passing message alert service.
is possible, , best way?
assuming server can render string $scope.variable placeholder, $interpolate seems you're looking for.
please see documentation
Comments
Post a Comment