Skip to content

a8m/angular-code-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d0f17ad · Oct 15, 2014

History

50 Commits
Aug 28, 2014
Sep 21, 2014
Sep 21, 2014
Oct 6, 2014
Aug 25, 2014
Aug 25, 2014
Sep 5, 2014
Oct 6, 2014
Oct 15, 2014
Sep 21, 2014
Aug 25, 2014
Sep 21, 2014

Repository files navigation

#angular-code-mirror   Build Status Coverage Status

2 way binding code mirror for AngularJS based on google-prettify, v0.0.3

##Table of contents:

#Get Started (1) Get angular-code-mirror in one of 2 ways:

  • clone & build this repository
  • via Bower: by running $ bower install angular-code-mirror from your console

(2) Include angular-code-mirror.js (or angular-code-mirror.min.js) in your index.html, after including Angular itself.

(3) Include angular-code-mirror.css in the <head> tag

(4) Add 'ng-code-mirror' to your main module's list of dependencies.

When you're done, your setup should look similar to the following:

<!doctype html>
<html ng-app="myApp">
<head>
    <!--style-->
    <link rel="stylesheet" href="vendor/angular-code-mirror/css/angular-code-mirror.css"/>
    <!--scripts-->
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
    <script src="vendor/angular-code-mirror.min.js"></script>
    <script>
        var myApp = angular.module('myApp', ['ng-code-mirror']);

    </script>
    ...
</head>
<body>
    ...
</body>
</html>

#Example Example:

<body>
 ...
  <!-- add ng-model to your input/textarea -->
  <textarea  class="form-control" rows="20" ng-model="code">
  
  <!--select language and bind the model to the code-mirror directive-->
  <code-mirror lang="js" model="code"></code-mirror>
  
    <!--codemirror with line numbers-->
  <code-mirror lang="js" model="code" line-numbers="true"></code-mirror>
 ...
</body>

#TODO

  • Add presets/theme(Darcula, phpstorm, sublime, etc..)

#Development Clone the project:

$ git clone 
$ npm install
$ bower install

Run the tests:

$ grunt test

Deploy:
Run the build task, update version before(bower,package)

$ grunt build
$ git tag v0.*.*
$ git push origin master --tags

About

2 way binding codemirror for AngularJS based on google-prettify

Resources

License

Stars

Watchers

Forks

Packages

No packages published