This repository has been archived by the owner on Feb 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
70 lines (56 loc) · 2.75 KB
/
index.html
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
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8">
<title>Angular Image Fallback</title>
<meta name="author" content="CodeKraft Studio">
<meta name="description" content="Expect us, we are coming, the new full qualified web developers duo.">
<meta name="Robots" content="ALL,INDEX">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<meta property="og:title" content="CodeKraft, cutting edge programming!" />
<meta property="og:description" content="Expect us, we are coming, the new full qualified web developers duo" />
<meta property="og:image" content="http://core.codekraft.it/www.codekraft.it/quadkode.jpg" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.codekraft.it/" />
<meta property="og:site_name" content="CodeKraft, cutting edge programming!" />
<link rel="stylesheet" href="style.css">
</head>
<body>
<article>
<header>
<div class="hcont">
<h1>angular-image-fallback</b></h1>
<h2>a directive that handle errors in images loading</h2>
</div>
</header>
<section>
<div class="example-row">
<div class="col-third">
<h3>Default beheviour.</h3>
<img ng-src="errorLink.jpg" />
</div>
<div class="col-third">
<h3>Basic usage with default fallback.</h3>
<img class="thumb" ng-src="errorLink.jpg" image-fallback />
</div>
<div class="col-third">
<h3>With a custom fallback source.</h3>
<img class="thumb" ng-src="errorLink.jpg" image-fallback="http://www.clker.com/cliparts/0/4/6/1/11949904011525963418file_broken.svg.med.png" />
</div>
</div>
<div class="example-row">
<h2>How does it work?</h2>
<p>It should be used with <b>ng-src</b> attribute only, because the value of <b>src</b> will be evaluted before the module and angular itself, has been loaded.</p>
<p>The directive will load the fallback image if the source is not specified or if the source produces an error, even if is dynamically changed.</p>
<p>You can use a custom fallback image passing to the attribute <b>image-fallback</b>, if the source you provided can't be loaded, the default one will be used.</p>
</div>
</section>
</article>
</body>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.29/angular.min.js"></script>
<script type="text/javascript" src="dist/angular-image-fallback.min.js"></script>
<script>
angular.module('app', ['angular-image-fallback'])
</script>
</html>