This repository has been archived by the owner on May 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
77 lines (74 loc) · 2.67 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php switch (variable) {
case 'value':
# code...
break;
default:
# code...
break;
} ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./bower_components/bootstrap/dist/css/bootstrap.min.css">
<title>Angular Repeater</title>
</head>
<body>
<div class="container py-1" ng-app="DemoApp" ng-controller="DemoController as Ctrl">
<div class="row">
<div class="col-xs-12">
<h1 class="mb-2">Angular Repeater</h1>
<p>Directive that supports recursion</p>
<p>If you interested how to use this directive, please read this article: <a href="https://silvestarbistrovic.from.hr/en/articles/recursively-includible-angular-directive">Recursively includible Angular directive</a></p>
</div>
</div>
<hr class="my-2">
<div class="row">
<div class="col-xs-12">
<h2 class="mb-2">Usage</h2>
<p>First include Angular Repeater in your project:</p>
<pre><code>(function (DemoApp) {
'use strict';
DemoApp = angular.module('DemoApp', ['Repeater']);
DemoApp.config(function () {});
}(this));</code></pre>
<p>Than call recursive-repeater directive and provide it with an Angular model and label:</p>
<pre><code><recursive-repeater json-data="jsonData" label="MyLabel"></recursive-repeater></code></pre>
</div>
</div>
<hr class="my-2">
<div class="row">
<div class="col-xs-12">
<h2 class="mb-2">Demo</h2>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h4 class="mb-2">Model</h4>
<h6>
JSON data:
<select class="custom-select" ng-model="myJson" ng-change="ChangeData()"
ng-options="option.label for option in myJsonOptions track by option.url"></select>
</h6>
<pre><code>{{jsonData | json}}</code></pre>
</div>
<div class="col-md-6" ng-if="jsonData">
<h4 class="mb-2">Output</h4>
<recursive-repeater json-data="jsonData"></recursive-repeater>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<p><a href="https://github.com/maliMirkec/angular-repeater">Angular Repeater on Github</a></p>
</div>
</div>
</div>
<script src="./bower_components/angular/angular.min.js"></script>
<script src="./bower_components/jquery/dist/jquery.min.js"></script>
<script src="./bower_components/tether/dist/js/tether.min.js"></script>
<script src="./bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="./demo/dist/demo.js"></script>
</body>
</html>