D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
dslanger
Full window
Github gist
Angular Curriculum 08a
<body ng-app="appName"> <div class="container" ng-controller="MainController as mainCtrl"> <div class="row"> <div class="col-md-6 col-md-offset-3"> <p>Number is {{ number }}</p> <button class="btn btn-primary" ng-click="pickRandomNumber()">Pick Random Number</button> <h3>Word Reverser</3> <input type="text" class="form-control" ng-model="wordToReverse"/> <p>Your word is: {{ wordToReverse }}</p> <button class="btn btn-primary" ng-click="reverseWord()">Reverse Word</button> </div> </div> <div class="container"> <div class="row"> <h2 class="text-center">Ping Pong Score Keeper</h2> <div class="col-md-5 col-md-offset-1 score-panel text-center" ng-class="{ winner : playerOneScore == 11, loser : playerTwoScore == 11 && playerOneScore < 11}"> <h1>Player 1</h1> <h2 class="score">{{ playerOneScore }}</h2> <p ng-if="">Serving</p> <button class="scoreButton" ng-click="playerOnePoint()">Point</button> </div> <div class="col-md-5 col-md-offset-1 score-panel text-center" ng-class="{ winner : playerTwoScore == 11, loser : playerOneScore == 11 && playerTwoScore < 11}"> <h1>Player 2</h1> <h2 class="score">{{ playerTwoScore }}</h2> <p ng-if="">Serving</p> <button class="scoreButton" ng-click="playerTwoPoint()" >Point</button> </div> <div class="col-md-12 text-center"> <button class="btn primary-btn resetButton" ng-click="resetScore()">Reset</button> </div> </div> </div> <div class="row"> <div class="col-md-12"> <h2>//ng-mouseenter</h2> </div> <div class="col-md-12"> <h3>The div was entered {{enterCount}} times</h3> <div class="divbox" ng-mouseenter="enterCount = enterCount + 1"> </div> <div class="col-md-12"> <div class="divbox" ng-style="newBackGround" ng-mouseenter="newColor()"> </div> </div> <div class="col-md-12"> <div class="divbox three" ng-style="newBackGround2" ng-mouseenter="newColor2()"> </div> <button class="text-center col-md-4 col-md-offset-4" ng-click="replay()">Replay Colors</button> </div> </div> <div class="row"> <div class="col-md-12 piForm"> <form ng-submit="submitFav()" name="favPieForm"> <input name="name" type="text" ng-model="favoriteForm.name"> <input name="favorite_pie" type="text" ng-model="favoriteForm.favoritePie"> <input type="submit"> </form> Name: {{ favoriteForm.name }}<br> Favorite Pi: {{ favoriteForm.favoritePie }} </div> </div> </div> </body>