Tagged: angularjs – show/hide nav items if user is logged in

Create Dynamic hide and show Tabs content in Angularjs 0

Create Dynamic hide and show Tabs content in Angularjs

Create Dynamic hide and show Tabs content in Angularjs

In this Post We Will Explain About is Create Dynamic hide and show Tabs content in Angularjs With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Load angularjs tabs dynamically (Example) Example

In this post we will show you Best way to implement How to make tabs and data dynamic – angular, hear for How to use CSS and angularjs to hide and show tab content with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

angular bootstrap tab active Example

In this Example,First of all Add or Include External Libs Like as a(jQuery, css etc..), and then create a simple index.php or index.html page.After that crate a simple javascript file like as a index.js or main.js, It is also add your web-application First Header Part to some priority set.After that Include your relevant CSS Class.

External Include file

AngularJS is a simple JavaScript framework Include one type of the (library) based on a very user friedly popular software mvc based architecture menas called the MVC.

   <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>
   <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"></script>

index.html

The Angular simple directives and the User’s view HTML DOM in a web-application page form the HTML view. In our example(Pakainfo.com), the simple HTML view comprises the HTML All the element, and then simple two angular directives Like as a namely angular ng-app as well as agular ng-controller

<div class="container">
    <section ng-app="liveApp" ng-controller="liveCtrl as liveTab">
        <ul class="nav nav-pills">
            <li ng-class="{active:liveTab.setTab(1)}"><a href ng-click="liveTab.setTab(1)">Live Tab 1</a></li>
            <li ng-class="{active:liveTab.setTab(2)}"><a href ng-click="liveTab.setTab(2)">Live Tab 2</a></li>
            <li ng-class="{active:liveTab.setTab(3)}"><a href ng-click="liveTab.setTab(3)">Live Tab 3</a></li>
            <li ng-class="{active:liveTab.setTab(4)}"><a href ng-click="liveTab.setTab(4)">Live Tab 4</a></li>
        </ul>
        
        <div ng-show="liveTab.setTab(1)">
             <h4>Tab 1</h4>
        </div>
        <div ng-show="liveTab.setTab(2)">
             <h4>Tab 2</h4>
        </div>
        <div ng-show="liveTab.setTab(3)">
             <h4>Tab 3</h4>
        </div>
        <div ng-show="liveTab.setTab(4)">
             <h4>Tab 4</h4>
        </div>
    </section>
</div>

index.js

The simple angular controller works as a all the data of the mediator between HTML views and models.

(function () {
    var app = angular.module('liveApp', []);

    app.controller('liveCtrl', function () {
        this.liveTab = 1;

        this.setTab = function (tabId) {
            this.liveTab = tabId;
        };

        this.setTab = function (tabId) {
            return this.liveTab === tabId;
        };
    });
})();

Create a dynamic tab component with Angular

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example

Example

I hope you have Got What is Create a dynamic tab component with Angular
And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.