Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Make a card dynamic with Angular JS

angular.module('myApp', [])
  .controller('myCtrl', ['$scope', function($scope) {
    $scope.demos = [{
        paragrafo: 'richiesta',
        title: 'demo1',
        paragrafo2: 'dskjdfdjfdfjkdf',
        link: 'https://www.google.it',
      },
      {
        paragrafo: 'richiesta',
        title: 'demo2',
        paragrafo2: 'dfhfhfjgfkjghfjkgf',
        link: 'https://www.youtube.it',
      },
      {
        paragrafo: 'richiesta',
        title: 'demo3',
        paragrafo2: 'sjdsdjddfjdf',
        link: 'https://www.sportmediaset.it',
      },
      {
        paragrafo: 'richiesta',
        title: 'demo4',
        paragrafo2: 'sdjkdhdkjfhdjfh',
        link: 'https://www.elbocon.pe',
      },
    ];
  }])
  .component('card', {
    bindings: {
      demo: '<'
    },
    template: '<div class="card" style="width: 18rem"><div class="card-body"><p>{{$ctrl.demo.paragrafo}}</p><h5 class="card-title">{{$ctrl.demo.title}}</h5><h6 class="card-subtitle mb-2 text-muted"></h6><p class="card-text">{{$ctrl.demo.paragrafo2}}</p><a class="card-link">{{$ctrl.demo.link}}</a></div></div>'
  })
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
  <card demo="data" ng-repeat="data in demos">
  </card>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to change css of menu when scrolling 
Javascript :: angularjs Re-evalute expressions when page reloads via history 
Javascript :: AngularJs: Display HTML elements from string variable in JSP page 
Javascript :: angularjs How to add row after the last row in ng2 smart table 
Javascript :: angularjs New Entry Not reflacting in table after inserting New record in CRUD angular app 
Javascript :: Algolia backend search with Algolia Search Helper library for Angular.js 
Javascript :: AngularJS stuck in module 
Javascript :: How to get one items from my Firebase realtime Database with Angular Ionic 
Javascript :: AngularJS slick carousel filter by attribute 
Javascript :: How to map a JSON response with different indexes 
Javascript :: Error thrown after ending the audio track / array of tracks in React Native Track Player 
Javascript :: Target one specific Jquery Data Table theader for CSS styles 
Javascript :: the given sign-in provider is disabled for this firebase project 
Javascript :: restrict file input with react uploady 
Javascript :: Using javascript code in Jade views - if(variable) shows undefined instead of passing 
Javascript :: regex online converter 
Javascript :: show code in console very good 
Javascript :: convert pcap fiole to json tshark 
Javascript :: code with mosh swipable react native not working 
Javascript :: inspect vuex store 
Javascript :: ngrx angular Cannot add property 0, object is not extensible 
Javascript :: change button text dynamically angular 6 
Javascript :: js get first elements of array 
Javascript :: blob to wav javascript 
Javascript :: react js css style border 
Javascript :: prevent the Confirm Form Resubmission dialog | window.history.back() confirm form resubmission 
Javascript :: winston transport file another directory 
Javascript :: swal on submit angular with cancel butotn 
Javascript :: iconbuttons onclick redirect to another page on react 
Javascript :: java scrypt 
ADD CONTENT
Topic
Content
Source link
Name
3+9 =