12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <section>
- <ul class="nav nav-pills">
- <li ng-class="{ active:panels.isSelected(1) }">
- <a ng-click="panels.selectTab(1)">Description</a></li>
- <li ng-class="{ active:panels.isSelected(2) }">
- <a ng-click="panels.selectTab(2)">Specifications</a></li>
- <li ng-class="{ active:panels.isSelected(3) }">
- <a ng-click="panels.selectTab(3)">Reviews</a></li>
- </ul>
- <div class="panel" ng-show="panels.isSelected(1)">
- <h4>Description</h4>
- <p>{{ product.description }}</p>
- </div>
- <div class="panel" ng-show="panels.isSelected(2)" product-specs></div>
- <div class="panel" ng-show="panels.isSelected(3)">
- <h4>Reviews</h4>
- <blockquote ng-repeat="review in product.reviews">
- <b>Stars: {{ review.stars }}</b>
- {{ review.body }}
- <cite>by: {{ review.author }} on {{ review.createdOn | date }}</cite>
- </blockquote>
- <form name="reviewForm" novalidate
- ng-controller="ReviewController as reviewCtrl"
- ng-submit="reviewForm.$valid && reviewCtrl.addReview(product)">
- <blockquote>
- <b>Stars: {{ reviewCtrl.review.stars }}</b>
- {{ reviewCtrl.review.body }}
- <cite>by: {{ reviewCtrl.review.author }}</cite>
- </blockquote>
- <h4>Submit a Review</h4>
- <fieldset class="form-group">
- <select class="form-control"
- ng-model="reviewCtrl.review.stars"
- required>
- <option value disabled selected class>Rate the product</option>
- <option value="1">1 star</option>
- <option value="2">2 stars</option>
- <option value="3">3 stars</option>
- <option value="4">4 stars</option>
- <option value="5">5 stars</option>
- </select>
- </fieldset>
- <fieldset class="form-group">
- <textarea class="form-control"
- ng-model="reviewCtrl.review.body"
- required
- placeholder="Write a short review of the product"></textarea>
- </fieldset>
- <fieldset class="form-group">
- <label>by:</label>
- <input type="email"
- class="form-control"
- ng-model="reviewCtrl.review.author"
- required
- placeholder="john.doe@example.com"/>
- </fieldset>
- <div>reviewForm is {{ reviewForm.$valid }}</div>
- <input type="submit" value="Submit"/>
- </form>
- </div>
- </section>
|