I am beginner for IonicFramework and Angularjs. I am trying to built one app having left left and some described pages to show.
For Demo App I am using this snippet of code but I am able to retrieve the value after clicking at one of the option. But problem is like rendering some text using those value is not possible for me right now. For example I have to use some switch case pattern to show some data.
If I tried to click at Google, It must give me text as Google at main page and so on.
Here is snippet of code, I am using :-
<body ng-controller="MainCtrl">
<ion-nav-view></ion-nav-view>
<script id="templates/event-menu.html" type="text/ng-template">
<ion-side-menus>
<ion-side-menu-content>
<ion-nav-bar class="bar-positive"animation="no-animation">
<ion-nav-back-button class="button-icon ion-arrow-left-c">
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" ng-click="toggleLeft()">
</button>
</ion-nav-buttons>
<ion-nav-view animation="no-animation" name="menuContent"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left">
<ion-header-bar class="bar-assertive">
<h1 class="title">{{title}}</h1>
</ion-header-bar>
<ion-content>
<ul class="list" >
<li ng-repeat="website_name in website_names" >
<a class="item" href="" ng-click="select_website_type({{website_name.name}});" menu-close>{{website_name.name}}</a>
</li>
</ul>
</ion-content>
</ion-side-menu>
</ion-side-menus>
</script>
<script id="templates/home.html" type="text/ng-template">
<ion-view title="Welcome">
<ion-content padding="true">
<div class="list">
<!-- First -->
<a class="item item-thumbnail-left item-details" href="#">
<h2>Pretty Hate Machine</h2>
<p class="white-space-preline">Everything you need to know about the three names revealed by the government to Supreme Court today</p>
</a>
<!-- Second -->
<a class="item item-thumbnail-left item-details" href="#">
<h2>Smashing Pumpkins</h2>
<p>Siamese Dream</p>
</a>
</div>
</ion-content>
</ion-view>
</script>
</body>
Please have a look and suggest me where I am wrong. Click Here For CodePen.io
YOu should pass website name value in your function like this {{website_name.name}}