JavaScript Does Angularjs automatically sanitize all data before rendering to dom?

Does Angular sanitize all data when it gets rendered in the DOM automatically? ie, would this be safe:

// using 'ngSanitize'
angular.module('app', ['ngSanitize']);

// somewhere in controller
$http.get('/data').success(function(userdata) {
    $scope.user.description = userdata.description;
});

And then rendering it in the DOM:

<span> Hello there, {{ user.description }}</span>

or

<span ng-model="user.description"></span>

This might lead to an XSS vulnerability if Angular isn't auto sanitizing the data I'm displaying. If Angular doesn't auto sanitize, what are good way ensure that all data from server is sanitized before rendering?

Answer:1

I'm trying to implement loading animation of chart using transition animations by adding rows and refreshing the chart. But it behaves completely differently from what I expect. Here is the Fiddle ...

I'm trying to implement loading animation of chart using transition animations by adding rows and refreshing the chart. But it behaves completely differently from what I expect. Here is the Fiddle ...

I'm a complete newbie in Phaser, and I've been having this problem for the last couple of days. Basically, I want my player to collide with the CollisionsLayer in my .json tilemap, but it doesn't work ...

I'm a complete newbie in Phaser, and I've been having this problem for the last couple of days. Basically, I want my player to collide with the CollisionsLayer in my .json tilemap, but it doesn't work ...

I set 'overflow:hidden' on my html body with Javascript when I press a button. But when I do that the whole body moves 5 pixels or so to the left because the space of the scrollbar is gone. How do i ...

I set 'overflow:hidden' on my html body with Javascript when I press a button. But when I do that the whole body moves 5 pixels or so to the left because the space of the scrollbar is gone. How do i ...

  1. overflow hidden still scrolls
  2. overflow hidden still takes up space
  3. overflow hidden still visible
  4. overflow hidden but still scroll
  5. overflow hidden but still scrollable
  6. body overflow hidden still scrolling
  7. css overflow hidden still scrolling
  8. ios overflow hidden still scrolling
  9. overflow-x hidden still scrolls
  10. overflow hidden but can still scroll
  11. css overflow hidden but still scroll

I use django-swampdragon + angularjs to create simple django app which shows website requests in real-time. All of the Django logic is okay, but when I try make it respond in real-time the system ...

I use django-swampdragon + angularjs to create simple django app which shows website requests in real-time. All of the Django logic is okay, but when I try make it respond in real-time the system ...