2

Trying to figure out ng-if. Why is the alert function executed? Thanks

<div ng-if="false">
    <script> alert("a"); </script>
</div>
Ian Wood
  • 6,515
  • 5
  • 34
  • 73
BlackMouse
  • 4,442
  • 6
  • 38
  • 65

1 Answers1

11

Because the alert() will be executed before angular is loaded. There is no ng-if at this moment

trollr
  • 1,095
  • 12
  • 27