making sure is passing a string to the codeMirror

codeMirror expectes a string.

Adding a formatter is not enough to make sure that the editor receives a
sting, since the ngModel can have multiple formatters registered.

For example, if we have a ui-codemirror textarea combined with required

<textarea name="myfield" ui-codemirror required
ng-model="vm.myfield"></textarea>

the ngModel will have tow formatters: the ui-codemirror and the
required.

When $scope.vm.myfield is undefined, the required formatter  return
undefined, and this will be the last formatter to run

Here is the exception we will get from codemirror

TypeError: Cannot call method 'split' of undefined
at window.CodeMirror.splitLines
(http://localhost:1995/Scripts/codemirror/codemirror.js:5570:38)
at window.CodeMirror.createObj.setValue
(http://localhost:1995/Scripts/codemirror/codemirror.js:4773:31)
at null.setValue
(http://localhost:1995/Scripts/codemirror/codemirror.js:4972:40)
at link.ngModel.$render
(http://localhost:1995/Scripts/ui-codemirror.js:81:26)
at Object.ngModelWatch
(http://localhost:1995/Scripts/angular.js:14504:14)
at Object.watchExpression (<anonymous>:754:29)
at Scope.$digest (http://localhost:1995/Scripts/angular.js:9897:47)
at Scope.$delegate.__proto__.$digest (<anonymous>:844:31)
at Scope.$apply (http://localhost:1995/Scripts/angular.js:10137:24)
at Scope.$delegate.__proto__.$apply (<anonymous>:855:30)

Here is the formatter of required directive (from angular sources)

var validator = function(value) {
        if (attr.required &&
(isEmpty(value) || value === false)) {

ctrl.$setValidity('required', false);
          return;
        } else
{
          ctrl.$setValidity('required', true);
          return
value;
        }
      };

      ctrl.$formatters.push(validator);

As we can se the formatter returns undefined if the value isEmpty
fixed typo and added comment
[FIX] Resolve optional ngModel testing
Merge pull request #21 from douglasduteil/fix-utests-optionalNgModel

[FIX] Resolve optional ngModel testing
Merge pull request #20 from bfcamara/master

making sure is passing a string to the codeMirror
[FIX] jshint mixed spaces and tabs.
chore(travis): Run bower install twice to make sure it does
Like angular/angular.js is doing.

This is a work-around for Bower/Node.js issue (https://github.com/bower/bower/issues/830). We run `bower install` twice, as the probability of failing twice in a row is very low.
style(test): Reformat the sources
refactor: create CodeMirror with the default contructor !
No more using [`CodeMirror.fromTextArea`](http://codemirror.net/doc/manual.html#fromTextArea) to create the CodeMirror editor.
Direct copy of the original element attributes to the created CodeMittir editor
style(test): Flatten tests
Remove unnecessary `describe`
chore: Initialise the editor value with the element content
chore(demo): Update demo
docs: Update README
The CodeMirror events are better handled in the `onLoad` function.
feat: allow using it as an element
Merge pull request #22 from douglasduteil/refactor-uicodemirror-constructor

Refactor uicodemirror constructor
Close #17, Close #6
chore(karma): Update Karma version
chore(grunt): Simplify the grunt testing proccess.
`grunt serve` launch :
- a localhost
- a karma server
- a grunt watcher
feat: Makes the onChange event handled by ngChange
Merge pull request #14 from angular-ui/ft-onChangeUseNgChange

feat: remove onChange event in the directive options in favorur of ngChange
docs: Remove old event handling