Answer the question
In order to leave comments, you need to log in
How to create a nav-bar with Routing on a component?
Good afternoon, colleagues.
There is a nav bar
<md-content class="md-padding">
<md-nav-bar md-selected-nav-item="l.currentNavItem">
<md-nav-item md-nav-sref="home" name="/home">Главная</md-nav-item>
<md-nav-item md-nav-sref="contact" name="/contact">Контакты</md-nav-item>
<md-nav-item md-nav-sref="about" name="/about">О нас</md-nav-item>
</md-nav-bar>
<div class="ext-content">
</div>
</md-content>
(function () {
"use strict";
angular.module("layoutApp", ['ngMaterial', 'homeApp', 'contactApp', 'aboutApp' ])
})();
(function () {
'use strict';
angular.module('layoutApp')
.component("layouttag",
{
controllerAs: "l",
controller: [Layout],
bindToController: true,
templateUrl: "/App/layout/layout.html"
});
function Layout() {
var l = this;
l.$onInit = function () {
l.currentNavItem = "/home"
}
}
})();
(function () {
'use strict';
angular.module('homeApp')
.component("hometag",
{
controllerAs: "h",
controller: [Home],
templateUrl: "/App/home/home.html"
});
function Home() {
var h = this;
}
})();
(function () {
'use strict';
angular.module('contactApp')
.component("contacttag",
{
controllerAs: "c",
controller: [contact],
templateUrl: "/App/contact/contact.html"
});
function Сontact() {
var c = this;
}
})();
(function () {
'use strict';
angular.module('aboutApp')
.component("abouttag",
{
controllerAs: "a",
controller: [About],
templateUrl: "/App/about/about.html"
});
function About() {
var a = this;
}
})();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question