Advertisement
Guest User

Untitled

a guest
Apr 16th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. $http.get('/paste/' + $scope.paste).success(getCallback);
  2.  
  3. var getCallback = function(data) {
  4. setTimeout(function() {
  5. $scope.paste = data[0].code;
  6. $scope.$apply();
  7. }, 0);
  8. };
  9.  
  10. app.filter('pretty', function() {
  11. return function(text) {
  12. // a method in the prettify.js
  13. return prettyPrintOne(text, '', true);
  14. };
  15. });
  16.  
  17. <pre ng-bind-html="paste|pretty"></pre>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement