BBCode or Bulletin Board Code is a lightweight markup language used to format posts in many message boards. This AngularJS extension was made to do same for dynamically loaded content, e.g. asynchronous pages or posts.
See attached index.htm file for examples.
- Bolded Text [b]example-text[/b]
- Underlined Text [u]example-text[/u]
- Italized Text [i]example-text[/i]
StrikethroughText [s]example-text[/s]- Colored Text [color=#FF0000]example-text[/color]
- Simple Image [img]url-to-image[/img]
- Image with title [img=url-to-image]image-title[/img]
- Simple URL [url]http://www.example.com[/url]
- URL with Title [url=http://www.example.com]url-title[/url]
website.html
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0-rc.0/angular.min.js" type="text/javascript"></script> // Include main AngularJS-code
<script src="angularjs-bbcode.js" type="text/javascript"></script> // Include BBCode extension
<script src="your-app.js" type="text/javascript"></script> // Include your app code
</head>
<body ng-app="your-app">
<div ks-nl2br ks-bbcode> // Apply new line formatter with ks-nl2br and apply bb code formatter with ks-bbcode
Dies ist [b]fetter[/b] Text.
Dies ist [I]kursiver[/I] Text.
Dies ist [U]unterstrichener[/U] Text.
Dies ist [S]durchgestrichener[/S] Text.
Dies ist [color=#ff0000]farbener[/I] Text.
[URL]http://www.example.com[/URL]
</div>
</body>
</html>
your-app.js
angular.module('your-app', ['bbModule']);