NgRepeat with Controller As Test

Size
2,482 Kb
Views
30,360

How do I make an ngrepeat with controller as test?

What is a ngrepeat with controller as test? How do you make a ngrepeat with controller as test? This script and codes were developed by Michael E Conroy on 23 August 2022, Tuesday.

NgRepeat with Controller As Test Previews

NgRepeat with Controller As Test - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>ngRepeat with Controller As Test</title> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'>
</head>
<body> <div class='container' ng-app='myApp'> <div ng-controller='myCtrl as mc'> <div ng-repeat='t in mc.test track by $index'> <em>{{t.id}}:</em> <strong>{{t.content}}</strong> </div> <button class='btn btn-primary' ng-click='mc.addObject()'>Add Object</button> </div>
</div> <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

NgRepeat with Controller As Test - Script Codes JS Codes

(function() { var app; app = angular.module('myApp', []); app.controller('myCtrl', function($log) { var _that; _that = this; this.test = [ { id: 0, content: 'Object one' }, { id: 1, content: 'Object two' }, { id: 2, content: 'Object three' }, { id: 3, content: 'Object four' } ]; this.addObject = function() { var _obj; _obj = { id: 4, content: 'New Object' }; $log.debug(_obj); this.test.push(_obj); $log.debug(this.test); return true; }; return void 0; });
}).call(this);
NgRepeat with Controller As Test - Script Codes
NgRepeat with Controller As Test - Script Codes
Home Page Home
Developer Michael E Conroy
Username m-e-conroy
Uploaded August 23, 2022
Rating 3
Size 2,482 Kb
Views 30,360
Do you need developer help for NgRepeat with Controller As Test?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Michael E Conroy (m-e-conroy) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!