style(docs): improve the formatting of events in docs

This commit is contained in:
Misko Hevery 2011-08-31 12:21:27 -07:00 committed by Igor Minar
parent ad3cc16eef
commit 3c80cf3df6
3 changed files with 16 additions and 8 deletions

View file

@ -221,7 +221,7 @@ Doc.prototype = {
} else if(atName == 'eventType') {
var match = text.match(/^([^\s]*)\s+on\s+([\S\s]*)/);
self.type = match[1];
self.source = match[2];
self.target = match[2];
} else {
self[atName] = text;
}
@ -531,11 +531,14 @@ Doc.prototype = {
});
});
dom.h('Events', this.events, function(event){
var signature = (event.param || []).map(property('name'));
dom.h(event.type + ' ' +
event.shortName + '(' + signature.join(', ') + ') on ' +
event.source, event, function(){
dom.h(event.shortName, event, function(){
dom.html(event.description);
dom.tag('div', {class:'inline'}, function(){
dom.h('Type:', event.type);
});
dom.tag('div', {class:'inline'}, function(){
dom.h('Target:', event.target);
});
event.html_usage_parameters(dom);
self.html_usage_this(dom);

View file

@ -420,3 +420,8 @@ li {
[ng\:cloak], .ng-cloak {
display: none;
}
.inline * {
display: inline;
}

View file

@ -70,7 +70,7 @@ angularServiceInject('$route', function($location, $routeParams) {
* @ngdoc event
* @name angular.service.$route#$beforeRouteChange
* @eventOf angular.service.$route
* @eventType Broadcast on root scope
* @eventType broadcast on root scope
* @description
* Broadcasted before a route change.
*
@ -89,7 +89,7 @@ angularServiceInject('$route', function($location, $routeParams) {
* @ngdoc event
* @name angular.service.$route#$afterRouteChange
* @eventOf angular.service.$route
* @eventType Broadcast on root scope
* @eventType broadcast on root scope
* @description
* Broadcasted after a route change.
*
@ -108,7 +108,7 @@ angularServiceInject('$route', function($location, $routeParams) {
* @ngdoc event
* @name angular.service.$route#$routeUpdate
* @eventOf angular.service.$route
* @eventType Emit on the current route scope.
* @eventType emit on the current route scope
* @description
*
* The `reloadOnSearch` property has been set to false, and we are reusing the same