Angular1.4.9_nonassign

by Shogo Kawahara

HTML

<div ng-app="myApp">
  <div ng-controller="mainCtrl">
    <div>
      Hello, World.
    </div>
    <widget></widget>
  </div>
</div>

CSS

</style> <script src="//code.angularjs.org/1.4.8/angular.js"></script> <style> </style>

JavaScript

angular.module('myApp', [])
  .controller('mainCtrl', function($scope) {})
  .directive('widget', function() {
    return {
      scope: {
        "obj": "="
      },
      template: "<div>{{obj}}</div>",
      link: function(scope, element, attributes) {
        scope.obj = scope.obj || "Hi, this is a bug between 1.4.x and 1.4.8."
      }
    }
  });