title: How to use Blade inside ng-repeat?
body: <p>I'm having an issue displaying a button to a post if a user made it, it renders out multiple buttons when i only need one</p>
  
  <p>Note:im using laravel, and im utilizing blade templating for <a href="https://laravel.com/docs/5.5/authorization#via-blade-templates" rel="nofollow noreferrer">policies</a>, and its the following line of code</p>
  
  <p><code>@if(Auth::user()-&gt;can('delete',$post))</code></p>
  
  <p>i need the post variable, in order for it to work. however if i don't do a for each, the post would be undefined, i need a way for the if statement to know its one of the post with out looping through posts this will render multiple buttons.</p>
  
  <p>I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/f4fGa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f4fGa.png" alt="enter image description here"></a></p>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;div id="mypost" class="col-md-8 panel-default" ng-repeat="post in myposts"&gt;
      &lt;div id="eli-style-heading" class="panel-heading"&gt;&lt;% post.title %&gt;&lt;/div&gt;
      &lt;div class="panel-body panel"&gt;
          &lt;figure&gt;
              &lt;p&gt; &lt;% post.body %&gt;&lt;/p&gt;
              &lt;p&gt; by: &lt;% post.user.name %&gt;&lt;/p&gt;
              &lt;p&gt; &lt;% post.created_at %&gt;&lt;/p&gt;
          &lt;/figure&gt;
          &lt;span&gt;
  
              @foreach($posts as $post)
                  @if(Auth::user()-&gt;can('delete',$post))
                   &lt;i style="color:red;" class="glyphicon glyphicon-remove" ng-click="deletePost(post)"&gt;&lt;/i&gt;
                  @endif
              @endforeach
  
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>PostController.php:</strong></p>
  
  <pre><code>public function index()
  {
      $posts = Post::with('user')-&gt;get();
  
      return view('home', compact('posts'));
  }
  </code></pre>