Skip to content

Instantly share code, notes, and snippets.

@gmittica
Created October 18, 2017 13:11
Show Gist options
  • Select an option

  • Save gmittica/7fe3e9ddaa78419bc65d7c0835cccf1f to your computer and use it in GitHub Desktop.

Select an option

Save gmittica/7fe3e9ddaa78419bc65d7c0835cccf1f to your computer and use it in GitHub Desktop.
Lesson // source https://jsbin.com/piweyat
<!DOCTYPE html>
<html >
<head>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://rawgit.com/angular/bower-angular/master/angular.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Lesson</title>
</head>
<body ng-app="myApp">
<div class="container">
<div class="well" ng-controller="myCtrl">
<h1>My list</h1>
<h3 ng-class="{'text-danger': $even}" ng-repeat="(key, el) in list track by $index">{{ key }}. {{ el }}</h3>
</div>
</div>
<script id="jsbin-javascript">
angular.module("myApp", [])
.controller("myCtrl", ['$scope', function($scope) {
//$scope.list = ["a", "a", "b", "c", "d", "e", "f"];
$scope.list = {
one: "a string",
two: "another string"
}
}]);
</script>
<script id="jsbin-source-javascript" type="text/javascript">angular.module("myApp", [])
.controller("myCtrl", ['$scope', function($scope) {
//$scope.list = ["a", "a", "b", "c", "d", "e", "f"];
$scope.list = {
one: "a string",
two: "another string"
}
}]);
</script></body>
</html>
angular.module("myApp", [])
.controller("myCtrl", ['$scope', function($scope) {
//$scope.list = ["a", "a", "b", "c", "d", "e", "f"];
$scope.list = {
one: "a string",
two: "another string"
}
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment