支持内容嵌入object, embbed等

This commit is contained in:
yafeilee 2014-05-25 12:03:29 +08:00
parent 05db669f91
commit 77a34a80a3
2 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
@app.controller 'AdminPostsController', [ '$scope', '$http', '$location', '$timeout', '$cookies', ($scope, $http, $location, $timeout, $cookies)->
@app.controller 'AdminPostsController', [ '$scope', '$http', '$location', '$timeout', '$cookies', '$sce', ($scope, $http, $location, $timeout, $cookies, $sce)->
$scope.body_active = true
@ -23,6 +23,9 @@
.success (res)->
$scope.previewHTML = res
$scope.trustAsPreviewHTML = ()->
$sce.trustAsHtml($scope.previewHTML)
$scope.addTag = (e)->
new_labels= $(e.target).text()
if $scope.labels

View File

@ -31,7 +31,7 @@
.content-field ng-show="body_active" ng-model= 'content'
= f.input :content, :as=> :text, :label => false, input_html: { name: 'content', "ng-model"=>'content', 'ng-initial'=>'' }
.preview.markdown ng-hide="body_active" ng-bind-html=" previewHTML "
.preview.markdown ng-hide="body_active" ng-bind-html=" trustAsPreviewHTML() "
.row
.small-12.large-6.columns.posts-button