-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshotDescription.html
More file actions
47 lines (43 loc) · 1.74 KB
/
Copy pathshotDescription.html
File metadata and controls
47 lines (43 loc) · 1.74 KB
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
<!DOCTYPE html>
<html>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="angular-resource-1.0.0rc6.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular-sanitize.js"></script>
<body>
<div ng-app="myApp" ng-controller="personCtrl">
<h1>{{ names.title }}</h1>
<br>
<br>
<h2>{{ names.user.name }}</h2>
<img ng-src="{{ names.user.avatar_url }}"/>
<p ng-bind-html="names.user.bio | unsafe"></p>
<br>
<br>
<img ng-src="{{ names.images.normal }}"/>
<br>
<br>
<p ng-bind-html="names.description | unsafe"></p>
</div>
<script>
var token = "88b060a97d22603df099f51011f2450cc991c98afe1ebd83ba4ac7f1f6f5c857";
var app = angular.module('myApp', []);
var string;
app.controller('personCtrl', function($scope, $http, $location, $timeout, $sce) {
$timeout(executaAposRenderizar, 0);
function executaAposRenderizar() {
var url = $location.url();
var id = url.substring(url.lastIndexOf("/") + 1);
var promise = $http.get("https://api.dribbble.com/v1/shots/" + id + "?access_token=" + token);
promise.success(function (response) {
$scope.names = response;
});
};
});
app.filter('unsafe', function($sce) {
return function(val) {
return $sce.trustAsHtml(val);
};
});
</script>
</body>
</html>