Im trying to execute a like POST request with a in angular. The url gets filled in correctly as you can see<a href> Post request always returns to wrong URL Angular
<a href="http://dressfriends.app/en/like/product/1006" target="_parent" df-like-product="" class="icon-like trigger animated v-a-m active" data-id="1006" data-type="product" ng-class="{active:product.liked_by_user}"></a>
In the code it looks like this
<a href="##product.like_url##" target="_parent" df-like-product class="icon-like trigger animated v-a-m" data-id="##product.id##" data-type="product" ng-class="{active:product.liked_by_user}"></a>
But everytime it gives a 405 method not allowed (http://dressfriends.app)と戻り私は角なしでPHPで正確なsamethingを行うと、これは誰でもアイデア
<a href="{{ $product->present()->likeUrl }}" df-like-product class="icon-like trigger animated v-a-m {{ ($currentUser and $product->hasLiked($currentUser->id)) ? 'active' : '' }}" data-id="{{ $product->id }}" data-type="product"></a>
に動作しますか?
...
https://docs.angularjs.org/api/ng/service/ $ HTTP
https://www.sitepoint.com/creating-crud-app-minutes-angulars-resource/ を。それにPOSTする場合は、フォームまたはajaxを使用する必要があります。 – aynber
しかし別のビューではPHP laravel bladeを使用していますが、hrefで動作しますか?違いは何ですか? – Janvdt
そのコードがなければ、私は言うことができませんでした。または、GETルートが定義されている可能性があります。 – aynber