angularjs - Ng-switch vs ng-repeat in Angular -
i have web application , dynamic, have create template , retrieve data json. in particular have these cards:
<!doctype html> <html> <head> <script data-require="jquery@*" data-semver="2.1.4" src="https://code.jquery.com/jquery-2.1.4.js"></script> <link href="style.css" rel="stylesheet" /> <script src="script.js"></script> </head> <body class="landing"> <section id="intro"> <div class="inner"> <h2>title</h2> <!-- cards --> <div class="cards"> <div class="riga"> <div class="r2"> <div class="r4"> <div class="card-container manual-flip"> <div onclick="rotatecard(this)" class="card"> <div class="front"> <div class="cover"> <img src="img/rotating_card_thumb2.png" /> </div> <div class="user"> <img src="img/img1.png" class="img-circle" /> </div> <div class="content"> <div class="main"> <h3 class="name">text</h3> <p class="profession">text</p> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> </div> <div class="footer"> <button class="btn btn-simple"> info </button> </div> </div> </div> <div class="back"> <div class="header"> <h5 class="motto">text</h5> </div> <div class="content"> <div class="main"> <h4 class="text-center">info</h4> </div> </div> <div class="footer"> <button class="btn btn-simple"> </button> </div> </div> </div> </div> </div> <div class="r4"> <div class="card-container manual-flip"> <div onclick="rotatecard(this)" class="card"> <div class="front"> <div class="cover"> <img src="img/rotating_card_thumb.png" /> </div> <div class="user"> <img src="img/img2.png" class="img-circle" /> </div> <div class="content"> <div class="main"> <h3 class="name">text</h3> <p class="profession">text</p> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> </div> <div class="footer"> <button class="btn btn-simple"> info </button> </div> </div> </div> <div class="back"> <div class="header"> <h5 class="motto">text</h5> </div> <div class="content"> <div class="main"> <h4 class="text-center">info</h4> </div> </div> <div class="footer"> <button class="btn btn-simple"> </button> </div> </div> </div> </div> </div> <div class="r4"> <div class="card-container manual-flip"> <div onclick="rotatecard(this)" class="card"> <div class="front"> <div class="cover"> <img src="img/rotating_card_thumb2.png" /> </div> <div class="user"> <img src="img/img3.png" class="img-circle" /> </div> <div class="content"> <div class="main"> <h3 class="name">text</h3> <p class="profession">text</p> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> <a onclick="rotatecard(this).disable();" class="actions button rimmed" href="#">text</a> </div> <div class="footer"> <button class="btn btn-simple"> info </button> </div> </div> </div> <div class="back"> <div class="header"> <h5 class="motto">text</h5> </div> <div class="content"> <div class="main"> <h4 class="text-center">info</h4> </div> </div> <div class="footer"> <button class="btn btn-simple"> </button> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- end inner --> </section> </body> </html>
i have n cards, , have own text. best solution create them dynamically? thought call before data, create card each of json string. best technique? use ng-repeat or ng-switch?
Comments
Post a Comment