Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. var term = new Terminal({
  2. cols: 80,
  3. rows: 24,
  4. screenKeys: true
  5. });
  6.  
  7. term.open(document.body);
  8. term.write('x1b[31mWelcome to term.js!x1b[mrn');
  9.  
  10. app.directive('terminal', function() {
  11. return {
  12. restrict: 'E',
  13. scope: {
  14. name: '@'
  15. },
  16. template: '<span>Hello {{name}}<div class="term"></div></span>',
  17. link: function(scope, elem, attrs) {
  18. var term = new Terminal({
  19. cols: 80,
  20. rows: 24,
  21. screenKeys: true
  22. });
  23. // window.w = elem;
  24. term.open(elem.find("div").get());
  25. term.write('x1b[31mWelcome to term.js!x1b[mrn');
  26. }
  27. }
  28. });
  29.  
  30. <terminal name="Terminal 1"></terminal>
  31.  
  32. TypeError: Cannot read property 'defaultView' of undefined
  33. at Terminal.open (http://localhost:4000/js/term.js:700:43)
  34. at link (http://localhost:4000/js/MyApp.js:23:18)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement