I have got a problem with my AngularJS function in my Wordpress-Application. What i want to create is a SPA, so that the Website(its not a blog, i'm just using WP as CMS) is working fluently and without reloading on mobile-phones. To achieve this goal, i decided to include AngularJS in Wordpress (if this isnt the best solution, please tell me :) ). After i made some Tutorials that explained to me the topic of the "views" in AJS, i tried to do it myself in a seperate html-document and it worked great.
So my problem is sumarized, that my SPA is divided in 3 colums. The left one is kind of static (just basic informations) the second one has always the newest content via WP (that works great, too) and the right colum should change its content by clicking on one of the links of the "newest content". Do you understand my idea till here? :) So, as you may guess - it doesnt really want to work.
<?php get_header();?> <!-- Header + AngularJS included -->
<div class="content"> <!-- open class="content"-->
<a href="/?page_id=6">
</a>
<div class="bg-texture"> <!--open class "bg-texture/ closed in "footer"-->
<?php while(have_posts()):the_post();?>
<div class="col">
<?php if (in_category('infotext')):?>
<div class="infotext">
<?php elseif (in_category('apps')):?>
<div class="round-borders-panel">
<?php elseif (in_category('righttext')):?> <!-- hier kommen die single-pages rein-->
<?php if(function_exists('get_twoclick_buttons')) {get_twoclick_buttons(get_the_ID());}?>
<?php endif;?>
<h1>
<a href="<?php the_permalink()?>"> <?php the_title();?> </a>
</h1>
<?php the_content(__(''));?>
</div>
</div>
<?php endwhile;?>
<?php get_the_ID('');?>
<script src="angular.min.js"></script>
<div data-ng-view></div>
<script>
var cloud = angular.module("cloud", []);
demoApp.config(function ($routeProvider) {
$routeProvider
.when('/?=p<?php get_the_ID();?>,
{
controller: 'SimpleController',
templateUrl: '<?php get_template_part('single','');?>'
})
.when('/view2',
{
controller: 'SimpleController',
templateUrl: 'Partials/view2.html'
})
.when('/view3',
{
controller: 'SimpleController',
templateUrl: 'Partials/view3.html'
})
.otherwise({redirectTo: '/view1'});
});
</script>
<!-- Loop-->
</div> <!-- Close <class="bg-texture-->
-->
It won't work right now, for sure. I would appreciate if you help me to solute this problem. BTW i started programming about 5 weeks ago - so there might be some really stupid miskates of a newbie! :)
Greetings, Yannic :)