Is it possible to retrieve an input $scope from outside ion-view?


I have been trying to retrieve the scope of my search input but with no success. I think it’s because my search input is outside the ion-view but I am not sure. Any idea what am I doing wrong?

Here is my HTML:

  <ion-pane ion-side-menu-content>
    <ion-nav-bar class="bar-positive item-input-inset nav-title-slide-ios7">
      <ion-nav-back-button class="button-clear"><i class="icon ion-ios7-arrow-left header-nav-icon"></i> &nbsp; </ion-nav-back-button>
      <button menu-toggle="left" class="button button-icon ion-navicon"></button>
      <label class="item-input-wrapper">
      <i class="icon ion-ios7-search placeholder-icon"></i>
      <input type="text" placeholder="Search" ng-model="search.query">
    <ion-nav-view name="menuContent" animation="slide-left-right"></ion-nav-view>

  <ion-side-menu side="left">
    <header class="bar bar-header bar-dark">
      <h1 class="title">Menu</h1>

<ion-view title="">
<ion-nav-buttons side="right">
  <button class="button button-icon ion-search" ng-click="doSearch(search.query);"></button>

<ion-nav-buttons side="right">
  <button class="button button-icon ion-refresh" ng-click="reloadPage()" ></button>

  <ion-content class="has-header image_background_section">...</ion-content>

And my controller:

.controller('SearchController', [
	'$scope', 'SearchService', '$ionicLoading', '$location', 'appConfig', '$ionicPopup',
	function ($scope, SearchService, $ionicLoading, $location, appConfig, $ionicPopup) {

		$scope.doSearch = function() {
      console.log("Query...." + $;

I have been struggling on this problem for a few days. Any help is very appreciate.



do you have a pen setup for someone to review?

no sorry I dont have a pen. Does it work with ionic?

a codePen… see example here with your sample code in it