Html AngularJS+SwitchCase用于通过单击列表项呈现不同的URL
我是AngularJs的begginer,在我的angularapp中,我想根据从左菜单中选择的选项传递URL。但我没有办法接触到这些Html AngularJS+SwitchCase用于通过单击列表项呈现不同的URL,html,angularjs,routing,Html,Angularjs,Routing,我是AngularJs的begginer,在我的angularapp中,我想根据从左菜单中选择的选项传递URL。但我没有办法接触到这些 <ion-content> <ul class="list"> <a href="#/ShowItems" class="item" menu-close>Yahoo</a> <a href="#/ShowItems" class="item" menu-close>Google&l
<ion-content>
<ul class="list">
<a href="#/ShowItems" class="item" menu-close>Yahoo</a>
<a href="#/ShowItems" class="item" menu-close>Google</a>
</ul>
</ion-content>
脚本页面模板
我试图添加开关的情况下,在角度根据选择的URL特定的网页将呈现
先谢谢你
更新
添加了几个链接,我想以这种方式显示页面。我想要的页面标题,根据点击的链接,并在布局内呈现该页面
你可以用
HTML
在输入类型中,按您的需要放置{currentURL}。但我不想为每次单击创建单独的页面。在单个页面中,我希望呈现单击的URL值。您希望在何处呈现单击的URL值?您可以看到templates/show_items.html有一个输入框。在这方面,我会把一个开关条件,并根据这一点,我会改变内容。我试图按照你的建议,但它没有显示任何东西。表示页面呈现,但值不存在。我已编辑控制器部分,请检查它。当Google或Yahoo的X-Frame-Options响应头设置为deny时,如果要在中呈现页面,则会出现问题。
<script id="templates/show_items.html" type="text/ng-template">
<ion-view title="Yahoo">
<ion-content>
<form class="list" ng-show="showForm">
<div class="item item-divider">
URL Info
</div>
<label class="item item-input">
<input type="text" placeholder="CurrentURL" ng-model="">
</label>
<div class="padding">
<button class="button button-block" ng-click="submit()">Checkin</button>
</div>
</form>
</ion-content>
</ion-view>
</script>
<ion-content>
<ul class="list">
<a href="#/ShowItems" class="item" menu-close ng-click="item('yahoo')">Yahoo</a>
<a href="#/ShowItems" class="item" menu-close ng-click="item('google')">Google</a>
</ul>
</ion-content>
$scope.item = function(site){
if(site == 'yahoo'){
$scope.currentURL = "www.yahoo.com";
}else{
$scope.currentURL = "www.google.com";
}
}