Form action with variable not valid after update to 1.2

前端 未结 1 1288
一向
一向 2020-12-18 19:21

I was generating a form action in my previous version of AngularJS using this code:

相关标签:
1条回答
  • 2020-12-18 19:56

    Since Angular 1.2.x, you can bind only one expression as URL.

    Hence, on your controller, do the following:

    $scope.actionUrl = $scope.api + '/products/image';
    

    And in the template:

    <form action="{{ actionUrl }}">
    

    Update

    As suggested by @Fourth:

    <form action="{{ api + '/products/image' }}">
    
    0 讨论(0)
提交回复
热议问题