Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- http://pastebin.com/u/NelloRizzo -->
- <!-- http://pastebin.com/zDi5M0yq -->
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>AngularJS Single Page Application</title>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
- </head>
- <body>
- <div class="container" data-ng-app="app">
- <h1>Gestione di un Semplice Blog</h1>
- <div data-ng-controller="EditController">
- <h2>Inserimento Articolo</h2>
- <form class="form" role="form" name="f" novalidate>
- <div class="dialog-alert" data-ng-if="f.$dirty && f.$invalid">
- Errori:
- <ul>
- <li data-ng-if="f.title.$error.required">
- Il titolo è obbligatorio.
- </li>
- <li data-ng-if="f.title.$error.minlength">
- La lunghezza del titolo è troppo breve.
- </li>
- <li data-ng-if="f.content.$error.maxlength">
- Contenuto troppo lungo.
- </li>
- </ul>
- </div>
- <fieldset>
- <legend>Articolo</legend>
- <div class="row">
- <label for="title">Titolo</label>
- <span class="push-right"
- data-ng-if="f.title.$invalid">
- *
- </span>
- <input data-ng-required="true"
- data-ng-minlength="3"
- class="form-control" name="title" data-ng-model="post.title" />
- </div>
- <div class="row">
- <label for="content">Contenuto [Restano {{ 20 - post.content.length }} caratteri]</label>
- <textarea
- data-ng-maxlength="20"
- class="form-control" name="content" data-ng-model="post.content"></textarea>
- </div>
- <div class="row">
- <label for="author">Autore</label>
- <input class="form-control" name="author" data-ng-model="post.author" />
- </div>
- <button class="form-control"
- data-ng-disabled="f.$invalid"
- data-ng-click="save()">
- Salva
- </button>
- </fieldset>
- </form>
- </div>
- <div data-ng-controller="ListController">
- <h2>Elenco Articoli</h2>
- <ol data-ng-hide="posts && posts.length == 0">
- <li data-ng-repeat="post in posts">
- {{ post.title | uppercase | reverse }}
- pubblicato in data {{ post.date | date: 'd/M/yyyy hh:mm' }}
- </li>
- </ol>
- <span data-ng-show="!posts || posts.length == 0">
- Nessun articolo in archivio.
- </span>
- <span data-ng-if="!posts || posts.length == 0">
- Nessun articolo in archivio con NG-IF!
- </span>
- </div>
- </div>
- <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>"
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.js"></script>
- <script src="js/app.filters.js"></script>
- <script src="js/app.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement