textAngular v1.4.5 =========== [](https://travis-ci.org/fraywing/textAngular) [](https://coveralls.io/r/fraywing/textAngular) Demo is available at: http://www.textangular.com (Or editable [Plunkr Demo](http://plnkr.co/edit/kKPfk0LCXWrMpZ1gkblb?p=preview)) #### Upgrading From 1.2.2 or earlier To upgrade from version 1.2.2 or earlier you need to follow these steps: 1. The styling for textAngular is now in the `dist/textAngular.css` file, you will need to include this or a copy of it with your own modifications. 2. The rangy library is now required, you will need both the `rangy-core` and `rangy-saveselection` modules, alternatively you can include the compressed version (`textAngular-rangy.min.js`) in the dist folder ## Requirements 1. `AngularJS` ≥ `1.3.x` 2. `Rangy` ≥ `1.3.x`, Both rangy-core and rangy-saveselection are required. (There is a minified combination of these two included in the dist folder) 3. `Font-Awesome` ≥ `4.x` for the default icons on the toolbar 1. `Bootstrap` ≥ `3.x` for the default styles (Can use `bootstrap-css-only`, you must add this to your bower or include this manually) 5. NOTE: please check the requirements for earlier releases, if these are an issue. ### Where to get it **NOTE:** Our `textAngular-sanitize.js` and angular.js's `angular-sanitize.js` are the SAME file, you must include one or the other but not both. We highly recommend using `textAngular-sanitize.js` as it loosens some parts of the sanitizer that are far too strict for our uses and adds some more features we need. **Via Bower:** Run `bower install textAngular` from the command line. Include script tags similar to the following: ```html ``` **Via NPM:** Run `npm install textangular` from the command line. Include script tags similar to the following: ```html ``` Install using commonjs (eg componentjs, Webpack, Browserify): ``` angular.module('myModule', [require('angular-sanitize'), require('textAngular')]); ``` Optionally, install textAngular-santize.min.js by requiring it BEFORE requring textAngular: ``` require('textangular/dist/textAngular-sanitize.min'); angular.module('myModule', [require('textAngular')]); ``` For CSS support with Webpack, install the style-loader, css-loader (and postcss-loader) and configure the loader in your webpack.config.js similar to the following: ``` loaders: [ {test: /\.css$/, loader: 'style!css!postcss'} ] ``` **Via CDNJS:** Include script tags similar to the following: ```html ``` **Via jsDelivr:** Include script tag similar to the following: (For details on how this works see: [https://github.com/jsdelivr/jsdelivr#load-multiple-files-with-single-http-request](https://github.com/jsdelivr/jsdelivr#load-multiple-files-with-single-http-request)) ```html ``` **Via Github** Download the code from [https://github.com/fraywing/textAngular/releases/latest](https://github.com/fraywing/textAngular/releases/latest), unzip the files then add script tags similar to the following: ```html ``` ### Usage 1. Include (`rangy-core.js` and `rangy-saveselection.js`) or `textAngular-rangy.min.js` in your project using script tags 2. Include `textAngular-sanitize.js` or `textAngular-sanitize.min.js` in your project using script tags 3. Include (`textAngularSetup.js` and `textAngular.js`) or `textAngular.min.js` (textAngularSetup.js is included inside textAngular.min.js) 4. Add a dependency to `textAngular` in your app module, for example: ```angular.module('myModule', ['textAngular'])```. 5. Create an element to hold the editor and add an `ng-model="htmlVariable"` attribute where `htmlVariable` is the scope variable that will hold the HTML entered into the editor: ```html
``` OR ```html