我页面顶部有以下三个按钮,下方是输入框。
基本上,我想要做的是当其中一个按钮被点击时,ng-click调用相应的页面并传递参数“showName”。 请告诉我如何修复它。谢谢。
<div>
<form>
<div>
Enter Show Name<input type="text" ng-model="showName" />
</div>
</form>
</div>
<div>
<button ng-click="href="/api/renameShow"">Rename Show</button>
<button ng-click="href="/api/updateShow"">Update Show</button>
<button ng-click="href="/api/checkShow"">Check Show</button>
</div>
我的模块代码及路由如下:
var showApp = angular.module("showApp", ["ngRoute", "ngResource", "ui"]).
config(function ($routeProvider, $locationProvider) {
$routeProvider.
when('/',
{
controller: '',
templateUrl: 'main.html'
}).
when('/api/renameShow', { controller: 'renameShowCtrl', templateUrl: '/templates/renameShow.html' }).
when('/api/updateShow', { controller: 'updateShowCtrl', templateUrl: '/templates/updateShow.html' }).
when('/api/checkShow', { controller: 'checkShowCtrl', templateUrl: '/templates/checkShow.html' });
基本上,我想要做的是当其中一个按钮被点击时,ng-click调用相应的页面并传递参数“showName”。 请告诉我如何修复它。谢谢。