139139 */
140140
141141
142+ /**
143+ * @ngdoc service
144+ * @name angular.module.ng.$compileProvider
145+ * @function
146+ *
147+ * @description
148+ *
149+ */
142150$CompileProvider . $inject = [ '$provide' ] ;
143151function $CompileProvider ( $provide ) {
144152 var hasDirectives = { } ,
@@ -148,7 +156,21 @@ function $CompileProvider($provide) {
148156 MULTI_ROOT_TEMPLATE_ERROR = 'Template must have exactly one root element. was: ' ;
149157
150158
151- this . directive = function registerDirective ( name , directiveFactory ) {
159+ /**
160+ * @ngdoc function
161+ * @name angular.module.ng.$compileProvider.directive
162+ * @methodOf angular.module.ng.$compileProvider
163+ * @function
164+ *
165+ * @description
166+ * Register directives with the compiler.
167+ *
168+ * @param {string } name Name of the directive in camel-case. (ie <code>ngBind</code> which will match as
169+ * <code>ng-bind</code>).
170+ * @param {function } directiveFactory An injectable directive factroy function. See {@link guide/directive} for more
171+ * info.
172+ */
173+ this . directive = function registerDirective ( name , directiveFactory ) {
152174 if ( isString ( name ) ) {
153175 assertArg ( directiveFactory , 'directive' ) ;
154176 if ( ! hasDirectives . hasOwnProperty ( name ) ) {
@@ -295,12 +317,14 @@ function $CompileProvider($provide) {
295317 *
296318 * @param {string } key Normalized key. (ie ngAttribute) .
297319 * @param {function(*) } fn Function that will be called whenever the attribute value changes.
320+ * @returns {function(*) } the `fn` Function passed in.
298321 */
299322 $observe : function ( key , fn ) {
300323 // keep only observers for interpolated attrs
301324 if ( this . $$observers [ key ] ) {
302325 this . $$observers [ key ] . push ( fn ) ;
303326 }
327+ return fn ;
304328 }
305329 } ;
306330
0 commit comments