This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> | |
<title>AngularJS ♥ WordPress</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular-route.min.js"></script> | |
<script src="js/app.js"></script> | |
<body class="container"> |
This file contains hidden or 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
(function(){ | |
var app = angular.module('angular♥wp', ['ngRoute']); | |
})(); |
This file contains hidden or 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
<html lang="en" ng-app="angular♥wp"> | |
... | |
<h1 class="text-center">AngularJS ♥ WordPress</h1> | |
<div ng-view></div> |
This file contains hidden or 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
(function(){ | |
var app = angular.module('angular♥wp', ['ngRoute']); | |
app.config(function($routeProvider, $locationProvider){ | |
// Enable html5 mode | |
$locationProvider.html5Mode(true); | |
// configure routing | |
$routeProvider.when('/', { | |
templateUrl: 'content.html', |
This file contains hidden or 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
<p>this is our content.html<br> | |
We want to load the content from WordPress here. |
This file contains hidden or 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
(function(){ | |
var app = angular.module('angular♥wp', ['ngRoute']); | |
var api = {}; | |
app.config(function($routeProvider, $locationProvider){ | |
// Enable html5 mode | |
$locationProvider.html5Mode(true); | |
// configure routing | |
$routeProvider.when('/', { |
This file contains hidden or 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
(function(){ | |
var app = angular.module('angular♥wp', ['ngRoute']); | |
var api = {}; | |
// JSON content location | |
api.query = 'http://amielucha.com/wp-json/wp/v2/posts/'; | |
app.config(function($routeProvider, $locationProvider){ | |
// Enable html5 mode | |
$locationProvider.html5Mode(true); |
This file contains hidden or 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
<section> | |
<article class="well" ng-repeat="post in posts"> | |
<header> | |
<h1>{{post.title.rendered}}</h1> | |
</header> | |
<div class="post-content"> | |
{{post.excerpt.rendered}} | |
</div> | |
</article> | |
</section> |
This file contains hidden or 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
(function(){ | |
var app = angular.module('angular♥wp', ['ngRoute']); | |
var api = {}; | |
// JSON content location | |
api.query = 'http://amielucha.com/wp-json/wp/v2/posts/'; | |
app.config(function($routeProvider, $locationProvider){ | |
// Enable html5 mode | |
$locationProvider.html5Mode(true); |
This file contains hidden or 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
<h2>Item:</h2> | |
<section> | |
<article class="well" ng-repeat="post in posts"> | |
<header> | |
<h1 ng-bind-html="post.title.rendered"> | |
{{post.title.rendered}} | |
</h1> | |
</header> | |
<div class="post-content" ng-bind-html="post.excerpt.rendered"> | |
{{post.excerpt.rendered}} |