我使用了以下控制器,但是如何将 README.MD 原始文件的每一行格式化为 html 文档
angular.module('ExampleApp', [])
.controller('ExampleController', function($scope, Slim,$sce) {
Slim.getReadme().then(function(resp) {
$scope.readme = $sce.trustAsHtml(resp.data);
}).catch(function(resp) {
console.log("catch", resp);
});
})
.service('Slim', function($http) {
return {
getReadme: function() {
return $http.get("https://api.github.com/repos/btford/angular-markdown-directive/readme", {
headers: {
"Accept": "application/vnd.github.v3.raw"
}
});
}
};
});
我很高兴知道将原始自述文件转换为格式化的 html 页面