Skip to content

Commit adc7b1d

Browse files
committed
enable basic summernote
1 parent f135b22 commit adc7b1d

File tree

5 files changed

+62
-1
lines changed

5 files changed

+62
-1
lines changed

.bowerrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"directory": "components"
2+
"directory": "examples/components"
33
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ tmp/
77
.project
88
.cache
99
.settings/
10+
11+
examples/components/

bower.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"components"
88
],
99
"dependencies": {
10+
"summernote": "~0.5.0",
11+
"angular": "~1.2.8"
1012
},
1113
"devDependencies": {}
1214
}

examples/index.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en" ng-app="summernoteDemo">
3+
<head>
4+
<title>Angular-summernote Demo</title>
5+
6+
<!--summernote dependencies-->
7+
<script src="components/jquery/jquery.min.js"></script>
8+
<link rel="stylesheet" href="components/bootstrap/dist/css/bootstrap.min.css">
9+
<script src="components/bootstrap/dist/js/bootstrap.min.js"></script>
10+
<link rel="stylesheet" href="components/font-awesome/css/font-awesome.min.css">
11+
12+
<!--summernote-->
13+
<link rel="stylesheet" href="components/summernote/dist/summernote.css" />
14+
<script src="components/summernote/dist/summernote.min.js"></script>
15+
16+
<!--angular-summernote dependencies -->
17+
<script src="components/angular/angular.min.js"></script>
18+
<script src="../src/angular-summernote.js"></script>
19+
</head>
20+
<body>
21+
<summernote></summernote>
22+
23+
<script>
24+
angular.module('summernoteDemo', ['summernote']);
25+
</script>
26+
</body>
27+
</html>

src/angular-summernote.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/**
2+
* Copyright (c) 2013 JeongHoon Byun aka "Outsider", <http://blog.outsider.ne.kr/>
3+
* Licensed under the MIT license.
4+
* <http://outsider.mit-license.org/>
5+
*/
6+
7+
angular.module('summernote', [])
8+
9+
.controller('SummernoteController', ['$scope', '$attrs', function($scope, $attrs) {
10+
11+
this.activate = function(scope, element) {
12+
element.summernote();
13+
};
14+
15+
}])
16+
.directive('summernote', [function() {
17+
return {
18+
restrict: 'EA',
19+
transclude: true,
20+
replace: true,
21+
controller: 'SummernoteController',
22+
scope: {},
23+
template: '<div class="summernote"></div>',
24+
link: function(scope, element, attrs, summernoteController) {
25+
summernoteController.activate(scope, element);
26+
}
27+
};
28+
}]);
29+
30+

0 commit comments

Comments
 (0)