Is there a way to display the "back button" on a subview?

As a newcomer to Ionic, I am finding navigation to be the most challenging aspect. My app has two tabs - "Dashboard" and "Friends". When I click on the Dashboard tab, I want it to navigate to a subview called "subview_dash", without displaying the tabs in that view. However, I am struggling to make the return button appear in "subview_dash".

https://i.stack.imgur.com/OjeIw.jpg https://i.stack.imgur.com/xA7EB.jpg

Can someone help me figure out how to achieve this? Any guidance would be greatly appreciated.

.state('tab', {
    url: "/tab",
    abstract: true,
    templateUrl: "tabs.html"
  })

  // Each tab has its own nav history stack:

  .state('tab.dash', {
    url: '/dash',
    views: {
      'tab-dash': {
        templateUrl: 'tab-dash.html',
        controller: 'DashCtrl'
      }
    }
  })

  .state('tab.friends', {
    url: '/friends',
    views: {
      'tab-friends': {
        templateUrl: 'tab-friends.html',
        controller: 'DashCtrl'
      }
    }
  })

  .state('subview_dash', {
    url: '/subview_dash',
        templateUrl: 'tab-subview_dash.html',
        controller: 'DashCtrl'

  }) 

Here is my code:

http://plnkr.co/edit/Az3w9O8rkr7fJw4unIDz?p=preview

Answer №1

This particular piece of code is utilized in tab-subview_dash.html.

<ion-view title="subview_dash">
    <ion-nav-buttons side="left">
      <button class="button button-clear ion-arrow-left-c" ng-click="backButton()"></button>
    </ion-nav-buttons>
    <ion-content class="has-header">
       friends
    </ion-content>
</ion-view>

Be sure to include your function for backButton() and specify the path where you want the redirection to occur.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Access a folder in JavaScript using Flask

I need to specify a directory in a script. $images_dir = '{{url_for('.../pictures')}}'; In my flask application directory structure, it looks like this: Root -wep.py -templates -gallery.html -static -pictures The images are stored ...

Send a signal to a space, leveraging the distinct characteristics of each socket as input parameters

I am looking to send a function to a group of sockets, with each socket receiving the function along with a specific parameter unique to that particular socket. In my coding scenario, this distinctive variable represents the player's number. As socke ...

Leveraging multiple limitTo filters within a single ng-repeat directive in AngularJS 1

Instead of directly affecting the underlying PHP and MySQL code that fetches my data from a JSON file via XAMPP's virtual server using a REST API to AngularJS1, I have a query regarding manipulating the output. Let's assume I have a JSON containi ...

Exploring AngularJS: Utilizing limitTo and filter

I'm having some trouble with using angular's limitTo and filter together. I want to search for a value in the search box, then apply a limit to the number of results displayed by entering a number in the filter box and clicking apply filter. Howe ...

"What is the best way to manipulate arrays in vue.js using the map function

I'm currently dealing with a Vue code that incorporates anime.js. My code has grown substantially to over 1500 lines. In order for Stack Overflow to accept my question, I have only included 5 items of my sampleText, even though it actually consists of ...

Transferring a JavaScript variable to JSP using AJAX

I'm struggling to figure out the correct syntax to pass a JavaScript variable named "textVal" to a jsp file. Here is my code snippet: function show(textVal){ AJAX.onreadystatechange = handler; AJAX.open("POST","service.jsp",true); AJAX.setR ...

The Rails text area fails to load through JavaScript when a line break is detected

My comment form has a feature that displays the content of the text area using js. It functions properly unless a new line is entered in the text area, in which case it does not show up right away. However, after refreshing the page, the comment appears wi ...

Retrieve the current time of day based on the user's timezone

Currently, I am working with a firebase cloud function that is responsible for sending push notifications to my app. My main requirement is to send notifications only during the day time. To achieve this, I have integrated moment-timezone library into my p ...

AngularJS template build encountered gulp annotation error

As a newcomer to Gulp and not fully familiar with Node, I need some assistance in identifying the issue that arises when attempting to build a template from StartAngular. After downloading the template and following the instructions provided in the readme ...

jQuery DatePicker Not Displaying Calendar

I've been attempting to implement a date picker in jQuery. I've included the necessary code within the head tag: <link rel="stylesheet" type="text/css" media="screen" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jqu ...

How do I transform the date "Tue Nov 26 2019 16:00:00 GMT-0800" into the .NET JSON date format "/Date(1574812800000)/"?

I am looking to convert a date from ISO format to .NET JSON date format using JavaScript. For example, I want to change "Tue Nov 26 2019 16:00:00 GMT-0800" to "/Date(1574812800000)/". ...

Transform nested properties of an object into a new data type

I created a versatile function that recursively converts nested property values into numbers: type CastToNumber<T> = T extends string ? number : { [K in keyof T]: CastToNumber<T[K]> }; type StringMap = { [key: string]: any }; const castOb ...

Do you have any queries regarding JavaScript logical operators?

I'm struggling with understanding how the && and || operators work in my code. I created a small program to help myself, but it's just not clicking for me. The idea is that when you click a button, the startGame() function would be triggered. va ...

What is the correct way to align text in jsPDF?

I'm currently encountering an issue with the jsPDF library. Although PDF generation works fine, I am struggling to justify text properly. The align: 'justify' attribute seems to function the same as align: 'left', and setting a spe ...

What is the best way to deliver flash messages using Express 4.0?

Currently, my web application requires authentication, and I am encountering an issue with the signup page. If a user tries to sign up with an email that is already in the database, I want to display an error message. Here is the code snippet I am using on ...

Transforming a flow type React component into JSX - React protocol

I have been searching for a tooltip component that is accessible in React and stumbled upon React Tooltip. It is originally written in flow, but I am using jsx in my project. I am trying to convert the syntax to jsx, but I'm facing difficulties with t ...

Transform the text area in preparation for a GET request

Trying to figure out how to pass the text from a textarea into the source attribute of an image tag while retaining all formatting, including line breaks. After some research, it seems that the best way to accomplish this is by base 64 encoding the text a ...

I am experiencing an issue where my REST call is being triggered twice while using AngularJS

Why is my REST call triggering twice when I make the call from the UI? I am using Java v8 and AngularJS v1.6, here is the service: import com.project123.temp.component.ImportFileComponent; @Component @Path("project123/ImportFileService") @JsonIgnorePrope ...

Error message related to the callback type issue in Node.js with the http.createServer

Having recently embarked on my journey with node.js, I delved into various tutorials and encountered a stumbling block while attempting to refactor some code. The tutorial that caught my attention and led me to this hiccup can be found here: http://www.tu ...

Incorporating grids for a flickering drag and drop effect in Javascript

I have been working on developing a selection system for a tilemap image where users can select multiple tiles by dragging the mouse to increase the size of the selection container. However, I've noticed a flickering effect while holding down the mous ...