JSFiddle - React, Tailwind, and code Playground

by Abdul Ahmad

HTML

<div ng-app='app' ng-controller='one as o'>
  <div ng-repeat='item in o.list'>
    {{item}}
  </div>
  <button ng-click='o.breakBinding()'>
  click
  </button>
  <button ng-click='o.add()'>
  add
  </button>
</div>

JavaScript

angular.module('app', [])
.controller('one', one);

function one() {
	var self = this;
  self.index = 0;
  self.list = [
  	'one',
    'two',
    'three'
  ];
  self.breakBinding = function() {
  	self.list = [
    	'four', 
      'five', 
      'six'
    ]; 
  };
  self.add = function() {
  	self.list.push('new' + self.index);
    self.index += 1;
  };
}