Angularjs Implementing a Tab instance

Source: Internet
Author: User

Tag: Javascrip TNO border asc tle Col RIP Active splay

Note: events, loops, and assignments together make an error

Specific implementation:

<!DOCTYPE HTML><HTMLNg-app= "Test"><Head>    <title>TAB instances</title>    <Scriptsrc= "Js/angular.js"CharSet= "Utf-8"></Script>    <styletype= "Text/css">. Box button{Background-color:#ccc;        }. Box Button.active{Background-color:Pink;        }. Box Div{width:200px;Height:200px;Background-color:#ccc;Border:1px solid Black;Display:None;        }. Box Div.cur{Display:Block;        }    </style>    <Scripttype= "Text/javascript">Let mod=Angular.module ('Test', []); Mod.controller ('Main', function($scope) {$scope. now= 0; $scope. Item= {            'Button 1': '111111',            'Button 2': '222222',            'Button 3': '333333',            'Button 4': '444444',        }; $scope. Setnowfun=function(index) {$scope. now=index; }        //events, loops, and assignments together make an error    }); </Script></Head><BodyNg-controller= "Main">    <Divclass= "box">        <Buttonng-repeat= "(k,v) in item"class= "{{$index ==now? ') Active ': '} 'Ng-click= "Setnowfun ($index)">{{k}}</Button>        <Divng-repeat= "V in item"class= "{{$index ==now? ') Cur ': '} '>{{V}}</Div>    </Div></Body></HTML>

Angularjs Implementing a Tab instance

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.