After replicating an angular example from w3schools (found here), I encountered some issues with it not functioning correctly. Despite my efforts, the code appears to be accurate. Can anyone spot what might be going wrong?
To provide more context, here is a link to a Plunker showcasing my implementation: Plunker Experiment
Below are snippets of the Angular JS and HTML code used:
angular.module('myApp', []).controller('thingsCtrl', function($scope) {
$scope.things = [
{title: 'my title 1', content: 'my Content 1'},
title: 'my title 2', content: 'my Content 2'},
title: 'my title 3', content: 'my Content 3'},
title: 'my title 4', content: 'my Content 4'},
title: 'my title 5', content: 'my Content 5'},
title: 'my title 6', content: 'my Content 6'}
];
$scope.things2 = [
{title: 'my 2nd title 1', content: 'my Content 1'},
title: 'my 2nd title 2', content: 'my Content 2'},
title: 'my 2nd title 3', content: 'my Content 3'},
title: 'my 2nd title 4', content: 'my Content 4'},
title: 'my 2nd title 5', content: 'my Content 5'},
title: 'my 2nd title 6', content: 'my Content 6'}
];
});
HTML Structure:
<!DOCTYPE html>
<html>
<head>
<!-- CSS -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<!-- JS -->
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp" ng-controller="thingsCtrl">
<h1>Hello Plunker!</h1>
<div class="container">
<div class="row">
<div class="col-sx-6"><h4>My Subtitle</h4>
<div ng-repeat="x in things">
<div class="col-sx-6 col-sm-4 col-md-2">
<div class="cube">
<b>{{x.title}}</b> </br> {{x.content}}
</div>
</div>
</div>
</div>
<div class="col-sx-6"><h4>My Subtitle 2</h4>
<div ng-repeat="x in things2">
<div class="col-sx-6 col-sm-4 col-md-2">
<div class="cube">
<b>{{x.title}}</b> </br> {{x.content}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>