1

I'm a newbie when it comes to AngularJS and KeystoneJS, and I would really appreciate your help. Thank you guys.

I have done a serving mechanism for my Angular application which uses Express's express.static. At this point, my application can successfully load regular html-files from different locations to a particular page with the code below.

controller.js:

.controller('Ctrl', function ($scope, $http) {

    $scope.html = "testing";

    $http({
        url: 'content/content1.html',
        method: 'GET',
        responseType: 'text'    
    }).success(function(data) {
        $scope.html = data;
    }).error()

    $scope.message = 'Hello';
});

page.html:

<div ng-bind="html"></div>

routing.js

app.use(express.static(__dirname + '/content'));

Next, I would like to load content from a separate KeystoneJS CMS to this particular page in my own Angular application. Basically, I just want to be able to edit some content with KeystoneJS and publish the content on my separate Angular application automatically after that.

1) How can I get the pages exported from Keystone in a form of a html-page?

4

1 回答 1

1

我创建了一个 AngularJS+KeystoneJS Skeleton 入门应用程序,如果您想将 MEAN 与 KeystoneJS 一起使用,它应该可以帮助您入门:

https://github.com/dvdcastro/keystonejs-ng-skeleton

它展示了如何使用 keystone 基础设施服务多个 angularjs 项目。我选择了这个解决方案,因为翡翠是一个非常强大的模板引擎,它可以让你用 Angular 做更多的事情。

于 2015-07-30T21:35:20.000 回答