JSFiddle - React, Tailwind, and code Playground

by Viktor Zozulyak

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
  <h2>Check console for errors</h2>
  
  binding an item directly - no errors.
  <my-component my-arg="item"></my-component>
  binding with item in array - throws error <span class="error">this._getter is not a function</span>:
  <my-component my-arg="[item]"></my-component>
    binding with item as property of object - throws error <span class="error">this._getter is not a function</span>.
  <my-component my-arg="{someProp: item}"></my-component>
</div>

CSS

my-component-array, my-component {
  display: block;
  margin-bottom: 15px;
}
.error {
  color: red;
}

JavaScript

angular
  .module('myApp', [])
  .controller('myCtrl', ($scope) => {    
    $scope.item = Object.create({
      	get prop() { return this._getter(); }
    });
		Object.defineProperty($scope.item, '_getter', {value: () => 123});
  })
  .component('myComponent', {
    bindings: {myArg: '<'}, template: '{{$ctrl.myArg.prop}}'
  });