Guest User

Untitled

a guest
Oct 20th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. <tbody class="table-hover">
  2. <tr ng-repeat="(id,local) in $ctrl.locals | orderBy:sortType:sortReverse | filter: $ctrl.name | filter:$ctrl.address">
  3. <td>{{local.name}}</td>
  4. <td>{{local.address}}</td>
  5. <td>{{local.phone}}</td>
  6. <td>
  7. <button ng-click="$ctrl.editShop(id)" class="button expand success">Edit</button>
  8. </td>
  9. </tr>
  10. </tbody>
  11.  
  12. angular.module('app')
  13. .component('articleComponent', {
  14. bindings: {
  15. name: '<',
  16. address: '<'
  17. },
  18. templateUrl : 'app/articles/articles.html',
  19. controller : function(deliveryService, $location, $scope){
  20.  
  21. this.locals = deliveryService.getDetailLocals()
  22.  
  23. this.sortType= 'name';
  24. this.sortReverse = true;
  25.  
  26. this.editShop = function(id){
  27. $location.path("/edit/" + id)
  28. }
  29. }
  30. })
  31.  
  32. <form>
  33. <fieldset>
  34. <legend>{{ textButton }}</legend>
  35.  
  36. <div class="row">
  37. <div class="large-12 columns">
  38. <label>name</label>
  39. <input type="text" placeholder="name" ng-model="local.name" required>
  40. </div>
  41. </div>
  42.  
  43. <div class="row">
  44. <div class="large-4 columns">
  45. <label>Adress</label>
  46. <input type="text" placeholder="Edad" ng-model="local.adress" required>
  47. </div>
  48. </div>
  49. <button type="submit" class="button large-12">{{ textButton }}</button>
  50. </fieldset>
  51. </form>
  52.  
  53. angular
  54. .module('app')
  55. .component('editComponent', {
  56. bindings: {},
  57. templateUrl: 'app/edit/edit.html',
  58. controller: function ($scope, $routeParams) {
  59. $scope.textButton = "Edit user";
  60. console.log($scope.local) // --> undefined
  61. console.log($routeParams) // --> {id:'0'}
  62. }
  63. })
Add Comment
Please, Sign In to add comment