javascript - Hide template ng-view in Angular -


i working on application uses angualr. using index.html file shows on every page, there 1 page should not show. how can hide index.html file showing on specific page? appreciate suggestions/answers

thanks!

edit

this template remove:

    <!doctype html> <html lang="en" ng-app="agentsupportapp"> <head>     <meta charset="utf-8">     <meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />      <script src="js/lib/jquery/jquery-1.10.2.js"></script>     <link rel="stylesheet" href="css/app/fonts.css">     <!-- things related bootstrap -->     <link rel="stylesheet" href="css/bootstrap.css">     <script src="js/lib/bootstrap/bootstrap.js"></script>      <!-- things related angular -->     <script src="js/lib/angular/angular.js"></script>     <script src="js/lib/angular/angular-resource.js"></script>     <script src="js/lib/angular/angular-route.js"></script>     <script src="js/lib/angular/angular-sanitize.js"></script>      <!-- bootstrap lib angular -->     <script src="js/lib/bootstrap/angular/ui-bootstrap-tpls-0.11.0.js"></script>      <!-- things related internationalization -->     <script src="js/lib/i18next/i18next-1.7.1.js"></script>     <script src="js/lib/ng-i18next/ng-i18next.js"></script>      <!-- application related files -->     <link rel="stylesheet" type="text/css" href="css/app/main.css">     <link rel="stylesheet" type="text/css" href="css/app/error.css">     <link rel="stylesheet" type="text/css" href="css/app/customer_info.css">      <script src="js/app/app.js"></script>     <script src="js/app/config.js"></script>      <script src="js/app/factories.js"></script>      <!--directives go here -->     <script src="js/app/directives/active-menu.js"></script>     <!-- services go here-->     <script src="js/app/services/rest_service.js"></script>      <!-- controllers go here -->     <script src="js/app/controllers/error-controller.js"></script>     <script src="js/app/controllers/lang-controller.js"></script>     <script src="js/app/controllers/user-controller.js"></script>     <script src="js/app/controllers/nav-controller.js"></script>      <!-- screen specific contollers go here-->     <script src="js/app/controllers/drive-controller.js"></script>     <script src="js/app/controllers/drive-user-controller.js"></script>  </head> <body>     <div class="container">         <div class="header">             <div ng-include src="'views/common/topbar.html'"/>         </div>         <div class="row view-margin">             <div ng-view="" >             </div>         </div>         <div class="footer navbar-fixed-bottom">             <div ng-include src="'views/common/footer.html'"/>         </div>      </div> <!-- container --> </body> </html> 

app.js file:

  (function(){ "use strict";  var agentsupportapp = angular.module('agentsupportapp',[     'ngroute',     'ngsanitize',     'ngresource',     'subscriptioncontrollers',     'jm.i18next',     'ui.bootstrap'     ]);  /** * controller modules defined here */ angular.module('subscriptioncontrollers',[]);  /****end of controllers****/  agentsupportapp.run(['$rootscope',function($rootscope){     $rootscope.version = '1.0';     /*$rootscope.$on('$locationchangesuccess', function(){         console.log('event fired');     });*/ }]);  /* routing mapping fetch particular template when wanted*/ agentsupportapp.config(['$routeprovider',function($routeprovider){     $routeprovider.     //used     when('/error',{templateurl:'views/common/error.html', controller:'messagecontroller'}).     when('/dashboard',{templateurl:'views/dashboard.html'}).     when('/drive',{templateurl:'views/drive_support.html', controller:'drivecontroller'}).     when('/userdetail',{templateurl:'views/drive_user_detail.html', controller:'driveusercontroller'}).     otherwise({redirectto:'/dashboard'}); }]);  }()); 

use $location route url

using combination of $location , ng-hide/ng-show can hide page.

eg: suppose url variable storing value of url. can use

<div ng-hide="url==<url want hide html>"> </div> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -