forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ngSanitize): extract $sanitize, ngBindHtml, linkyFilter into a …
…module Create build for other modules as well (ngResource, ngCookies): - wrap into a function - add license - add version Breaks `$sanitize` service, `ngBindHtml` directive and `linky` filter were moved to the `ngSanitize` module. Apps that depend on any of these will need to load `angular-sanitize.js` and include `ngSanitize` in their dependency list: `var myApp = angular.module('myApp', ['ngSanitize']);`
- Loading branch information
Showing
20 changed files
with
301 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @license AngularJS v"NG_VERSION_FULL" | ||
* (c) 2010-2012 AngularJS http://angularjs.org | ||
* License: MIT | ||
*/ | ||
(function(angular) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
})(window.angular); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
|
||
|
||
/** | ||
* @ngdoc directive | ||
* @name angular.module.ngSanitize.directive.ngBindHtml | ||
* | ||
* @description | ||
* Creates a binding that will sanitize the result of evaluating the `expression` with the | ||
* {@link angular.module.ng.$sanitize $sanitize} service and innerHTML the result into the current | ||
* element. | ||
* | ||
* See {@link angular.module.ng.$sanitize $sanitize} docs for examples. | ||
* | ||
* @element ANY | ||
* @param {expression} ngBindHtml {@link guide/dev_guide.expressions Expression} to evaluate. | ||
*/ | ||
angular.module('ngSanitize').directive('ngBindHtml', ['$sanitize', function($sanitize) { | ||
return function(scope, element, attr) { | ||
element.addClass('ng-binding').data('$binding', attr.ngBindHtml); | ||
scope.$watch(attr.ngBindHtml, function(value) { | ||
value = $sanitize(value); | ||
element.html(value || ''); | ||
}); | ||
}; | ||
}]); |
Oops, something went wrong.