JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="MyApp">
<div ng-controller="PostCtrl">
<div ng-repeat="post in posts" ng-controller="postItemController">
<strong>{{post}}</strong>
<input type="text" ng-model="postText">
<a href="#" ng-click="savePost()">save post</a>
</div>
</div>
</div>
JavaScript
angular.module('MyApp',[]);
function PostCtrl($scope) {
$scope.posts = ['tech', 'news', 'sports', 'health'];
}
function postItemController($scope){
$scope.savePost = function(){
console.log($scope.postText + " which belongs to " + $scope.post +" will be saved")
}
}