Advertisement
NelloRizzo

[AJS] SinglePageApplication

Mar 14th, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.76 KB | None | 0 0
  1. <!-- http://pastebin.com/u/NelloRizzo -->
  2. <!-- http://pastebin.com/zDi5M0yq -->
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7.     <title>AngularJS Single Page Application</title>
  8.     <meta charset="utf-8" />
  9.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
  10. </head>
  11. <body>
  12.     <div class="container" data-ng-app="app">
  13.         <h1>Gestione di un Semplice Blog</h1>
  14.         <div data-ng-controller="EditController">
  15.             <h2>Inserimento Articolo</h2>
  16.             <form class="form" role="form" name="f" novalidate>
  17.                 <div class="dialog-alert" data-ng-if="f.$dirty && f.$invalid">
  18.                     Errori:
  19.                     <ul>
  20.                         <li data-ng-if="f.title.$error.required">
  21.                             Il titolo รจ obbligatorio.
  22.                         </li>
  23.                         <li data-ng-if="f.title.$error.minlength">
  24.                             La lunghezza del titolo รจ troppo breve.
  25.                         </li>
  26.                         <li data-ng-if="f.content.$error.maxlength">
  27.                             Contenuto troppo lungo.
  28.                         </li>
  29.                     </ul>
  30.                 </div>
  31.                 <fieldset>
  32.                     <legend>Articolo</legend>
  33.                     <div class="row">
  34.                         <label for="title">Titolo</label>
  35.                         <span class="push-right"
  36.                              data-ng-if="f.title.$invalid">
  37.                             *
  38.                         </span>
  39.                         <input data-ng-required="true"
  40.                               data-ng-minlength="3"
  41.                               class="form-control" name="title" data-ng-model="post.title" />
  42.  
  43.                     </div>
  44.                     <div class="row">
  45.                         <label for="content">Contenuto [Restano {{ 20 - post.content.length }} caratteri]</label>
  46.                         <textarea
  47.                                  data-ng-maxlength="20"
  48.                                  class="form-control" name="content" data-ng-model="post.content"></textarea>
  49.                     </div>
  50.                     <div class="row">
  51.                         <label for="author">Autore</label>
  52.                         <input class="form-control" name="author" data-ng-model="post.author" />
  53.                     </div>
  54.                     <button class="form-control"
  55.                            data-ng-disabled="f.$invalid"
  56.                            data-ng-click="save()">
  57.                         Salva
  58.                     </button>
  59.                 </fieldset>
  60.             </form>
  61.         </div>
  62.         <div data-ng-controller="ListController">
  63.             <h2>Elenco Articoli</h2>
  64.             <ol data-ng-hide="posts && posts.length == 0">
  65.                 <li data-ng-repeat="post in posts">
  66.                 {{ post.title | uppercase | reverse }}
  67.                 pubblicato in data {{ post.date | date: 'd/M/yyyy hh:mm' }}
  68.                 </li>
  69.             </ol>
  70.             <span data-ng-show="!posts || posts.length == 0">
  71.                 Nessun articolo in archivio.
  72.             </span>
  73.             <span data-ng-if="!posts || posts.length == 0">
  74.                 Nessun articolo in archivio con NG-IF!
  75.             </span>
  76.         </div>
  77.     </div>
  78.     <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>"
  79.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  80.     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.js"></script>
  81.  
  82.     <script src="js/app.filters.js"></script>
  83.     <script src="js/app.js"></script>
  84. </body>
  85. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement