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