JSFiddle - React, Tailwind, and code Playground
by Yang Tyler
HTML
<div ng-app>
<div ng-controller="TestController">
<div ng-repeat="apps in appCollections">
<ul ng-repeat="app in apps">
<li ng-click="logApp(app.id)">{{app.name}}</li>
</ul>
</div>
</div>
<button ng-click="addApp()">add!!!</button>
</div>
JavaScript
function TestController($scope){
$scope.appCollections = {
test:[
{
name:"test1", id: 1
},
{
name:"test2", id: 2
}
]
};
$scope.logApp = function(appId){
alert(appId);
};
$scope.addApp = function(){
$scope.appCollections.test.push({name:"test3",id: 3});
};
}