내 Wordpress-Application에서 AngularJS 기능에 문제가 있습니다. 내가 만들고 싶은 것은 SPA 다. 그래서 웹 사이트 (blog가 아니라, 나는 단지 CMS로서 WP를 사용하고있다)가 유창하게 그리고 휴대 전화로 다시로드하지 않고서 일하고있다. 이 목표를 달성하기 위해 Wordpress에 AngularJS를 포함하기로 결정했습니다 (이것이 가장 좋은 해결책이 아니라면 알려주세요 :)). AJS의 "의견"주제를 나에게 설명한 몇 가지 자습서를 작성한 후 별도의 HTML 문서로 직접 작성하려고 시도했지만 훌륭하게 작동했습니다.Wordpress의 AngularJS보기
내 SPA가 3 개 콜럼으로 나뉘어서 내 문제가 요약됩니다. 왼쪽은 정적 (일종의 기본 정보)이고, 두 번째 것은 항상 WP (최신 정보)를 통해 최신 콘텐츠를 보유하고 있으며, 오른쪽 열은 "최신 콘텐츠"링크 중 하나를 클릭하여 콘텐츠를 변경해야합니다. . 여기까지 내 생각을 이해하니? :) 짐작할 수 있듯이 정말로 일하고 싶지 않습니다.
<?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-->
->
그것은 확실히 지금 작동하지 않습니다. 이 문제를 해결하는 데 도움을 주시면 감사하겠습니다. BTW 나는 대략 5 주 전에 프로그램 시작했다 - 그래서 초심자의 진짜 어리석은 miskates가 있을지도 모르다! :)
인사말, Yannic :
다음을 확인하십시오 : https://github.com/HRoger/angularpresstheme -이 테마는 싱글 페이지 응용 프로그램으로 워드 프레스를 설정합니다. 여기에도 데모 버전이 있습니다 : http://angularpresstheme.com – RoyRogers