私はウェブプログラミングが初めてで、angularJs と ionic を使用してアプリを作成しています。
これが私の問題です。おそらく、正しい方法で対処したい問題です。サーバーとデータを交換してから、他の Web サイトにリンクするボタンがあります。ボタンに ng-clicked を追加して、サーバーと通信し、その後 $location.path() によって次の Web サイトを呼び出すスクリプトを実行するのが正しい方法であるかどうか疑問に思っています。
Problem with this is, that it always throws an error saying:
Error: $location is not defined $scope.click@http://localhost:8100/scripts/controllers.js:17:9 $parseFunctionCall@http://localhost:8100/lib/angular/angular.js:12237:15 @http://localhost:8100>/lib/ionic/release/js/ionic-angular.js:7788:9 $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8100/lib/angular/angular.js:14291:16 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8100/lib/angular/angular.js:14389:18 @http://localhost:8100/lib/ionic/release/js/ionic-angular.js:7787:7 jQuery.event.dispatch@http://localhost:8100/lib/jquery/dist/jquery.js:4408:15 jQuery.event.add/elemData.handle@http://localhost:8100/lib/jquery/dist/jquery.js:4095:6 triggerMouseEvent@http://localhost:8100/lib/ionic/release/js/ionic.js:2641:3 tapClick@http://localhost:8100/lib/ionic/release/js/ionic.js:2630:3 tapMouseUp@http://localhost:8100/lib/ionic/release/js/ionic.js:2700:5
私の他のアイデアは、次の Web サイトにリンクするボタンに href を設定することですが、リダイレクトする前にスクリプトが正常に実行されたことを確認できません。または、これを処理する方法はありますか?
ありがとう!