I am working on a website using AngularJS and Ui-router.
Index.html
<body>
<a href="#">Home Page</a>
<div ui-view></div>
</body>
Javascript:
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('baba', {
url:"/",
templateUrl: "baba.html"
})
.state('icerik', {
url: "/icerik/:ad",
templateUrl: "icerik.html",
controller: "mmgCtrl",
})
.state('oku', {
url: "/oku/:serix/:klasor",
templateUrl: "oku.html",
controller: "nbgCtrl"
})
$urlRouterProvider.otherwise('/');
})
baba.html:
<div class="wanTohide> //div that want to hide when ui-sref clicked
<a ui-sref="oku">State oku</a>
<a ui-sref="icerik">State icerik</a>
</div>
-If any of the ui-sref links are clicked, I want to hide or apply display:none
to the div with the class wanTohide
. The content should load in the ui-view
.
-I also want the Home Page
button to be functional.
<a href="">Home Page</a>