My body is layed out as such:
<body class="container" ng-controller="ArticleController as data">
<div class="dataholder" ng-repeat="cd in data.datas">
<h1 class="title">
{{cd.name}}<p class="date" ng-show="cd.date.length>0"> @ {{cd.date}}</p>
</h1>
<h3 class="description">{{cd.description}}</h3>
<!-- Comment placement -->
<div class="commentInput">
<input class="commentbox" ng-show="cd.commentable==true" type="text" placeholder='Comment on this'>
<button ng-show="cd.commentable==true" class="button">Post</button>
</div>
<div ng-repeat="comment in cd.comments" ng-show="cd.commentable==true" class="commentdiv">
<h5>
{{comment.name}}: <p class="comment">{{comment.text}}<p>
</h5>
</div>
</div>
I've imported: * AngularJS, * Firebase, * AngularFire.
I've searched quite a lot and have not found a way to make it able to post data to the firebase from within the ng-repeat enabled div. I want this for a comment system. I would want to do something like:
onclick='thisref.push( <text from the input in my body> )'
In my button.
But I have no idea how to:
- Let the code know which ref to use depending on what ng-repeat position it is.
- Use the value from the input.
Excuse my bad code. I'm quite new to web-design.