-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add experimental test (see asrob-uc3m/asrob-uc3m.github.io#18)
- Loading branch information
1 parent
4752b81
commit e2f73db
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<!doctype html> | ||
<head> | ||
{% include blog-head.html %} | ||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> | ||
</head> | ||
|
||
|
||
<body id="post-index" {% if page.image.feature %}class="feature"{% endif %}> | ||
|
||
{% include blog-browser-upgrade.html %} | ||
{% include blog-navigation.html %} | ||
|
||
<div class="entry-header"> | ||
{% if page.image.credit %}<div class="image-credit">Image source: <a href="{{ page.image.creditlink }}">{{ page.image.credit }}</a></div><!-- /.image-credit -->{% endif %} | ||
{% if page.image.feature %} | ||
<div class="entry-image"> | ||
<img src="{{ site.url }}/img/blog/{{ page.image.feature }}" alt="{{ page.title }}"> | ||
</div><!-- /.entry-image --> | ||
{% endif %} | ||
<div class="header-title"> | ||
<div class="header-title-wrap"> | ||
<h1>DEF: testing</h1> | ||
<h2>Testing JS</h2> | ||
</div><!-- /.header-title-wrap --> | ||
</div><!-- /.header-title --> | ||
</div><!-- /.entry-header --> | ||
|
||
<div id="main" role="main"> | ||
<article class="hentry"> | ||
<header class="header-title"> | ||
<div class="header-title-wrap"> | ||
<h1 class="entry-title">Testing JS with backend</h1> | ||
<h2><span class="entry-date date published">In GitHub pages! Yeah!</span></h2> | ||
</div><!-- /.header-title-wrap --> | ||
</header> | ||
<div class="entry-content" align="justify"> | ||
{% raw %} | ||
<div ng-app="myApp" ng-controller="myCtrl"> | ||
<p>Backend url: | ||
<input type="text" ng-model="backend_url"> | ||
<button ng-click="submit()">Get info!</button> | ||
<p>Data received from backend:</p> | ||
<ul> | ||
<li>Name: {{name}}</li> | ||
<li>Type: {{type}}</li> | ||
<li>Working: {{working}}</li> | ||
</ul> | ||
</div> | ||
{% endraw %} | ||
</article> | ||
</div><!-- /#main --> | ||
|
||
<div class="footer-wrapper"> | ||
<footer role="contentinfo"> | ||
{% include blog-footer.html %} | ||
</footer> | ||
</div><!-- /.footer-wrapper --> | ||
|
||
{% include blog-scripts.html %} | ||
|
||
<!-- My angular code --> | ||
<script> | ||
var app = angular.module('myApp', []); | ||
app.controller('myCtrl', function($scope, $http) { | ||
$scope.name = ""; | ||
$scope.type = ""; | ||
$scope.working = ""; | ||
$scope.submit = function() { | ||
$http.get($scope.backend_url).then(function (response) { | ||
$scope.name = response.data.name; | ||
$scope.type = response.data.type; | ||
$scope.working = response.data.working; | ||
}); | ||
} | ||
}); | ||
module.run(function($http) { | ||
$http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'; | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: testing | ||
--- | ||
|
||
asdfasdfasdfasdf |