-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
39 changed files
with
234 additions
and
173 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,7 @@ | ||
import templates from './templates/index.js'; | ||
|
||
let mod = angular.module('wordpress-hybrid-client.overwriteModule', [ | ||
templates | ||
]); | ||
|
||
export default mod = mod.name; |
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,3 @@ | ||
<div class="post padding"> | ||
<h1 class="item-title" ng-bind-html="customPostCtrl.id"></h1> | ||
</div> |
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,7 @@ | ||
<div list="posts"> | ||
<div class="list card card-posts repeat-animation" ng-repeat="item in customPostsCtrl.list"> | ||
<a ui-sref="public.customPosts.id({ id: item.id, slug: customPostsCtrl.type})"> | ||
{{item.id}} | ||
</a> | ||
</div> | ||
</div> |
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,8 @@ | ||
let mod = angular.module('wordpress-hybrid-client.overwriteTemplates', []); | ||
|
||
mod.run(($templateCache) => { | ||
$templateCache.put('customPost/example.html', require('!html!./customPost-example.html')); | ||
$templateCache.put('customPosts/example.html', require('!html!./customPosts-example.html')) | ||
}); | ||
|
||
export default mod = mod.name; |
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
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
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
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
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
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
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
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
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
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,27 @@ | ||
export default function() { | ||
return { | ||
bindToController: true, | ||
replace: false, | ||
controller: Controller, | ||
controllerAs: 'customPostCtrl', | ||
restrict: 'E', | ||
scope: { | ||
item: '=customPost', | ||
type: '@' | ||
}, | ||
template: ` | ||
<div ng-include="customPostCtrl.templateUrl" ng-if="customPostCtrl.type"></div> | ||
` | ||
}; | ||
|
||
function Controller($scope, $templateCache) { | ||
'ngInject'; | ||
|
||
var vm = this; | ||
vm.templateUrl = `customPost/${vm.type}.html`; | ||
|
||
if (!$templateCache.get(vm.templateUrl)) { | ||
throw new Error(`Template ${vm.templateUrl} does not exist`); | ||
} | ||
} | ||
} |
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,27 @@ | ||
export default function() { | ||
return { | ||
bindToController: true, | ||
replace: false, | ||
controller: Controller, | ||
controllerAs: 'customPostsCtrl', | ||
restrict: 'E', | ||
scope: { | ||
list: '=customPosts', | ||
type: '@' | ||
}, | ||
template: ` | ||
<div ng-include="customPostsCtrl.templateUrl" ng-if="customPostsCtrl.type"></div> | ||
` | ||
}; | ||
|
||
function Controller($scope, $templateCache) { | ||
'ngInject'; | ||
|
||
var vm = this; | ||
vm.templateUrl = `customPosts/${vm.type}.html`; | ||
|
||
if (!$templateCache.get(vm.templateUrl)) { | ||
throw new Error(`Template ${vm.templateUrl} does not exist`); | ||
} | ||
} | ||
} |
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
export default function($stateProvider) { | ||
'ngInject'; | ||
|
||
$stateProvider.state('public.posts', { | ||
url: "/posts", | ||
views: { | ||
'content': { | ||
template: require("./index.html"), | ||
controller: "WPHCPostsController as postsCtrl" | ||
$stateProvider | ||
.state('public.posts', { | ||
url: "/posts", | ||
views: { | ||
'content': { | ||
templateProvider: ($templateCache) => $templateCache.get('module/posts.html'), | ||
controller: "WPHCPostsController as postsCtrl" | ||
} | ||
} | ||
} | ||
}); | ||
}).state('public.posts.id', { | ||
url: "/:id", | ||
views: { | ||
'content@public': { | ||
templateProvider: ($templateCache) => $templateCache.get('module/post.html'), | ||
controller: "WPHCPostController as postCtrl" | ||
} | ||
} | ||
}); | ||
} |
Oops, something went wrong.