I have broken down my main html page to several sub pages and imported the child pages to main html file. Now, It seems each page refers to different '$scope' variables. I need to refer ng-modle="My-model" from one child page to another child page. Is that possble to do? My sample code as follows,
search-parent.html
<div class="widgets">
<div class="row accordions-row">
<div class="col-md-6" include-with-scope="serch.html"></div>
<div class="col-md-6" include-with-scope="other-search.html"></div>
</div>
</div>
search.html
<div class="col-sm-9">
<input type="text" class="form-control" ng-model="mymodel">
</div>
other-search.html
<div class="col-sm-9">
<input type="text" class="form-control" ng-model="mymodel">
</div>
Angular module configuration
(function () {
'use strict';
angular.module('my-module', [])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
$stateProvider
.state('state1', {
url: '/search',
controller: 'ctrl',
templateUrl: 'search-parent.html',
});
}
})();
thank you!