docs(test_lib/test_injector): fix invalid jsdoc type

chore(doc-gen): capture docs for modules from comments

Closes #1258

docs(*): add module description jsdoc tags
docs(*): add @public tag to public modules
chore(doc-gen): fix overview-dump template
The template was referencing an invalid property
chore(doc-gen): use `@exportedAs` and `@public` rather than `@publicModule`

This commit refactors how we describe components that are re-exported in another
module. For example the "public" modules like `angular/angular` and `angular/annotations`
are public but they only re-export components from "private" modules.

Previously, you must apply the `@publicModule` tag to a component that was to be
re-exported. Applying this tag caused the destination module to become public.

Now, you specify that a module is public by applying the `@public` tag and then
you can "re-export" components to other modules by applying the `@exportedAs`
giving the name of the module from which the component will be re-exported.
tag. This tag can be used multiple times on a single component, allowing the
component to be exported on multiple modules.

docs(*): rename `@publicModule` to `@exportedAs`

The `@publicModule` dgeni tag has been replaced by the `@exportedAs`
dgeni tag on components that are to be re-exported on another module.

Closes #1290
This commit is contained in:
Peter Bacon Darwin 2015-04-10 12:45:02 +02:00 committed by Misko Hevery
parent 82127571b5
commit b5002fb46b
47 changed files with 228 additions and 149 deletions

View File

@ -37,13 +37,16 @@ module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])
// Register the processors // Register the processors
.processor(require('./processors/generateDocsFromComments')) .processor(require('./processors/captureModuleExports'))
.processor(require('./processors/processModuleDocs')) .processor(require('./processors/captureClassMembers'))
.processor(require('./processors/processClassDocs')) .processor(require('./processors/captureModuleDocs'))
.processor(require('./processors/attachModuleDocs'))
.processor(require('./processors/cloneExportedFromDocs'))
.processor(require('./processors/generateNavigationDoc')) .processor(require('./processors/generateNavigationDoc'))
.processor(require('./processors/extractTitleFromGuides')) .processor(require('./processors/extractTitleFromGuides'))
.processor(require('./processors/createOverviewDump')) .processor(require('./processors/createOverviewDump'))
// Configure the log service // Configure the log service
.config(function(log) { .config(function(log) {
log.level = 'warning'; log.level = 'warning';
@ -63,6 +66,12 @@ module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])
}) })
.config(function(parseTagsProcessor, getInjectables) {
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/public'));
parseTagsProcessor.tagDefinitions.push(require('./tag-defs/exportedAs'));
})
// Configure file writing // Configure file writing
.config(function(writeFilesProcessor) { .config(function(writeFilesProcessor) {
writeFilesProcessor.outputFolder = 'dist/docs'; writeFilesProcessor.outputFolder = 'dist/docs';
@ -90,10 +99,6 @@ module.exports = new Package('angular', [jsdocPackage, nunjucksPackage])
]; ];
}) })
// Add in a custom tag that we use when generating public docs
.config(function(parseTagsProcessor) {
parseTagsProcessor.tagDefinitions.push({ name: 'publicModule' });
})
// Configure ids and paths // Configure ids and paths
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) { .config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {

View File

@ -0,0 +1,22 @@
var _ = require('lodash');
module.exports = function attachModuleDocs(log) {
return {
$runAfter: ['tags-extracted'],
$runBefore: ['computing-ids'],
$process: function(docs) {
return _.filter(docs, function(doc) {
if (doc.docType !== 'moduleDoc') {
return true;
}
if (doc.module || doc.module === '') {
doc.moduleDoc.description = doc.description;
doc.moduleDoc.public = doc.public;
log.debug('attached', doc.moduleDoc.id, doc.moduleDoc.description);
}
return false;
});
}
};
};

View File

@ -1,10 +1,10 @@
var _ = require('lodash'); var _ = require('lodash');
module.exports = function processClassDocs(log, getJSDocComment) { module.exports = function captureClassMembers(log, getJSDocComment) {
return { return {
$runAfter: ['processModuleDocs'], $runAfter: ['captureModuleExports'],
$runBefore: ['parsing-tags', 'generateDocsFromComments'], $runBefore: ['parsing-tags'],
ignorePrivateMembers: false, ignorePrivateMembers: false,
$process: function(docs) { $process: function(docs) {
var memberDocs = []; var memberDocs = [];

View File

@ -0,0 +1,31 @@
var _ = require('lodash');
module.exports = function captureModuleDocs(log, getJSDocComment) {
return {
$runAfter: ['captureClassMembers'],
$runBefore: ['parsing-tags'],
$process: function(docs) {
// Generate docs for each module's file's comments not already captured
_.forEach(docs, function(moduleDoc) {
if ( moduleDoc.docType !== 'module' ) return;
moduleDoc.extraComments = [];
_.forEach(moduleDoc.comments, function(comment) {
var jsDocComment = getJSDocComment(comment);
if (jsDocComment) {
jsDocComment.docType = 'moduleDoc';
jsDocComment.moduleDoc = moduleDoc;
moduleDoc.extraComments.push(jsDocComment);
docs.push(jsDocComment);
// console.log('found', jsDocComment.content);
}
});
if ( moduleDoc.extraComments.length > 0 ) {
// console.log(moduleDoc.extraComments.length);
}
});
}
};
};

View File

@ -1,12 +1,12 @@
var _ = require('lodash'); var _ = require('lodash');
module.exports = function processModuleDocs(log, ExportTreeVisitor, getJSDocComment) { module.exports = function captureModuleExports(log, ExportTreeVisitor, getJSDocComment) {
return { return {
$runAfter: ['files-read'], $runAfter: ['files-read'],
$runBefore: ['parsing-tags', 'generateDocsFromComments'], $runBefore: ['parsing-tags'],
$process: function(docs) { $process: function(docs) {
var exportDocs = []; var extraDocs = [];
_.forEach(docs, function(doc) { _.forEach(docs, function(doc) {
if ( doc.docType === 'module' ) { if ( doc.docType === 'module' ) {
@ -21,7 +21,7 @@ module.exports = function processModuleDocs(log, ExportTreeVisitor, getJSDocComm
_.forEach(visitor.exports, function(exportDoc) { _.forEach(visitor.exports, function(exportDoc) {
doc.exports.push(exportDoc); doc.exports.push(exportDoc);
exportDocs.push(exportDoc); extraDocs.push(exportDoc);
exportDoc.moduleDoc = doc; exportDoc.moduleDoc = doc;
if (exportDoc.comment) { if (exportDoc.comment) {
@ -40,7 +40,7 @@ module.exports = function processModuleDocs(log, ExportTreeVisitor, getJSDocComm
} }
}); });
return docs.concat(exportDocs); return docs.concat(extraDocs);
} }
}; };
}; };

View File

@ -0,0 +1,37 @@
var _ = require('lodash');
module.exports = function cloneExportedFromDocs(modules, EXPORT_DOC_TYPES) {
return {
$runAfter: ['tags-parsed', 'attachModuleDocs'],
$runBefore: ['computing-ids'],
$process: function(docs) {
var extraPublicDocs = [];
_.forEach(docs, function(doc) {
if (EXPORT_DOC_TYPES.indexOf(doc.docType) === -1 || !doc.exportedAs) return;
_.forEach(doc.exportedAs, function(exportedAs) {
var exportedAsModule = modules[exportedAs];
if (!exportedAsModule) {
throw new Error('Missing module definition: "' + doc.exportedAs + '"\n' +
'Referenced in "@exportedAs" tag on class: "' + doc.moduleDoc.id + '/' + doc.name + '"');
} else {
// Add a clone of export to its "exportedAs" module
var clonedDoc = _.clone(doc);
clonedDoc.moduleDoc = exportedAsModule;
exportedAsModule.exports.push(clonedDoc);
extraPublicDocs.push(clonedDoc);
}
});
});
docs = docs.concat(extraPublicDocs);
return docs;
}
};
};

View File

@ -3,7 +3,7 @@ var _ = require('lodash');
module.exports = function createOverviewDump() { module.exports = function createOverviewDump() {
return { return {
$runAfter: ['processModuleDocs', 'processClassDocs'], $runAfter: ['captureModuleExports', 'captureClassMembers'],
$runBefore: ['docs-processed'], $runBefore: ['docs-processed'],
$process: function(docs) { $process: function(docs) {
var overviewDoc = { var overviewDoc = {

View File

@ -1,34 +0,0 @@
var _ = require('lodash');
module.exports = function generateDocsFromComments(log) {
return {
$runAfter: ['files-read'],
$runBefore: ['parsing-tags'],
$process: function(docs) {
var commentDocs = [];
docs = _.filter(docs, function(doc) {
if (doc.docType !== 'atScriptFile') {
return true;
} else {
_.forEach(doc.fileInfo.comments, function(comment) {
// we need to check for `/**` at the start of the comment to find all the jsdoc style comments
comment.range.toString().replace(/^\/\*\*([\w\W]*)\*\/$/g, function(match, commentBody) {
// Create a doc from this comment
commentDocs.push({
fileInfo: doc.fileInfo,
startingLine: comment.range.start.line,
endingLine: comment.range.end.line,
content: commentBody,
codeTree: comment.treeAfter,
docType: 'atScriptDoc'
});
});
});
}
});
return docs.concat(commentDocs);
}
};
};

View File

@ -0,0 +1,4 @@
module.exports = {
name: 'exportedAs',
multi: true
};

View File

@ -0,0 +1,4 @@
module.exports = {
name: 'public',
transforms: function(doc, tag) { return true; }
};

View File

@ -23,7 +23,7 @@
{% for module in doc.modules %} {% for module in doc.modules %}
<h2>{$ module.id $} <h2>{$ module.id $}
{%- if module.publicModule %} (public){% endif %}</h2> {%- if module.public %} (public){% endif %}</h2>
{% for export in module.exports %} {% for export in module.exports %}
<h3>{$ export.name $}</h3> <h3>{$ export.name $}</h3>

View File

@ -6,9 +6,8 @@ module.exports = new Package('angular-public', [basePackage])
.processor(require('./processors/filterPublicDocs')) .processor(require('./processors/filterPublicDocs'))
.config(function(processClassDocs, filterPublicDocs, EXPORT_DOC_TYPES) { .config(function(captureClassMembers) {
processClassDocs.ignorePrivateMembers = true; captureClassMembers.ignorePrivateMembers = true;
filterPublicDocs.docTypes = EXPORT_DOC_TYPES;
}) })
// Configure file writing // Configure file writing

View File

@ -1,63 +1,28 @@
var _ = require('lodash'); var _ = require('lodash');
module.exports = function filterPublicDocs(modules) { module.exports = function filterPublicDocs(modules, EXPORT_DOC_TYPES) {
return { return {
$runAfter: ['tags-parsed'], $runAfter: ['tags-parsed', 'cloneExportedFromDocs'],
$runBefore: ['computing-ids'], $runBefore: ['computing-ids'],
docTypes: [],
$validate: {
docTypes: { presence: true }
},
$process: function(docs) { $process: function(docs) {
var extraPublicDocs = [];
docTypes = this.docTypes;
_.forEach(docs, function(doc) {
if (docTypes.indexOf(doc.docType) === -1 || !doc.publicModule) return;
var publicModule = modules[doc.publicModule];
if (!publicModule) {
throw new Error('Missing module definition: "' + doc.publicModule + '"\n' +
'Referenced in class: "' + doc.moduleDoc.id + '/' + doc.name + '"');
} else {
// Ensure module is marked as public
publicModule.isPublic = true;
// Add a clone of export to its "public" module
var publicDoc = _.clone(doc);
publicDoc.moduleDoc = publicModule;
publicModule.exports.push(publicDoc);
extraPublicDocs.push(publicDoc);
}
});
// Filter out the documents that are not public // Filter out the documents that are not public
docs = _.filter(docs, function(doc) { return _.filter(docs, function(doc) {
if (doc.docType === 'module') { if (doc.docType === 'module') {
// doc is a module - is it public? // doc is a module - is it public?
return doc.isPublic; return doc.public;
} }
if (docTypes.indexOf(doc.docType) === -1) { if (EXPORT_DOC_TYPES.indexOf(doc.docType) === -1) {
// doc is not a type we care about // doc is not a type we care about
return true; return true;
} }
// doc is in a public module // doc is in a public module
return doc.moduleDoc && doc.moduleDoc.isPublic; return doc.moduleDoc && doc.moduleDoc.public;
}); });
docs = docs.concat(extraPublicDocs);
return docs;
} }
}; };
}; };

View File

@ -1,8 +1,12 @@
/** /**
* @module
* @public
* @description
* Define public API for Angular here. * Define public API for Angular here.
*/ */
export * from './change_detection'; export * from './change_detection';
export * from './core'; export * from './core';
export * from './annotations'; export * from './annotations';
export * from './template';
export * from './directives'; export * from './directives';
export * from './forms'; export * from './forms';

View File

@ -1,4 +1,7 @@
/** /**
* @module
* @public
* @description
* Define public API for Angular here. * Define public API for Angular here.
*/ */
export * from './src/core/annotations/annotations'; export * from './src/core/annotations/annotations';

View File

@ -1,3 +1,10 @@
/**
* @module
* @public
* @description
* Description of the change_detection module
*/
export { export {
ASTWithSource, AST, AstTransformer, AccessMember, LiteralArray, ImplicitReceiver ASTWithSource, AST, AstTransformer, AccessMember, LiteralArray, ImplicitReceiver
} from './src/change_detection/parser/ast'; } from './src/change_detection/parser/ast';
@ -45,7 +52,7 @@ export var defaultPipes = {
/** /**
* @publicModule angular2/change_detection * @exportedAs angular2/change_detection
*/ */
export class DynamicChangeDetection extends ChangeDetection { export class DynamicChangeDetection extends ChangeDetection {
registry:PipeRegistry; registry:PipeRegistry;
@ -61,7 +68,7 @@ export class DynamicChangeDetection extends ChangeDetection {
} }
/** /**
* @publicModule angular2/change_detection * @exportedAs angular2/change_detection
*/ */
export class JitChangeDetection extends ChangeDetection { export class JitChangeDetection extends ChangeDetection {
registry:PipeRegistry; registry:PipeRegistry;

View File

@ -1,3 +1,9 @@
/**
* @module
* @description
* This is a description
*/
export {Inject, InjectPromise, InjectLazy, Injectable, Optional, DependencyAnnotation} from './src/di/annotations'; export {Inject, InjectPromise, InjectLazy, Injectable, Optional, DependencyAnnotation} from './src/di/annotations';
export {Injector} from './src/di/injector'; export {Injector} from './src/di/injector';
export {Binding, Dependency, bind} from './src/di/binding'; export {Binding, Dependency, bind} from './src/di/binding';

View File

@ -1,3 +1,10 @@
/**
* @module
* @public
* @description
* Describe the directives module here
*/
export * from './src/directives/class'; export * from './src/directives/class';
export * from './src/directives/for'; export * from './src/directives/for';
export * from './src/directives/if'; export * from './src/directives/if';

View File

@ -1,3 +1,10 @@
/**
* @module
* @public
* @description
* Describe the forms module here
*/
export * from './src/forms/model'; export * from './src/forms/model';
export * from './src/forms/directives'; export * from './src/forms/directives';
export * from './src/forms/validators'; export * from './src/forms/validators';

View File

@ -1,3 +1,6 @@
/** /**
* @module
* @public
* @description
* Define public API for Angular here. * Define public API for Angular here.
*/ */

View File

@ -2,7 +2,7 @@ import {ChangeDetector} from './interfaces';
import {CHECK_ONCE, DETACHED, CHECK_ALWAYS} from './constants'; import {CHECK_ONCE, DETACHED, CHECK_ALWAYS} from './constants';
/** /**
* @publicModule angular2/change_detection * @exportedAs angular2/change_detection
*/ */
export class BindingPropagationConfig { export class BindingPropagationConfig {
_cd:ChangeDetector; _cd:ChangeDetector;

View File

@ -27,7 +27,7 @@ export class IterableChangesFactory {
} }
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class IterableChanges extends Pipe { export class IterableChanges extends Pipe {
_collection; _collection;
@ -505,7 +505,7 @@ export class IterableChanges extends Pipe {
} }
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class CollectionChangeRecord { export class CollectionChangeRecord {
currentIndex:int; currentIndex:int;

View File

@ -4,7 +4,7 @@ import {stringify, looseIdentical, isJsObject} from 'angular2/src/facade/lang';
import {NO_CHANGE, Pipe} from './pipe'; import {NO_CHANGE, Pipe} from './pipe';
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class KeyValueChangesFactory { export class KeyValueChangesFactory {
supports(obj):boolean { supports(obj):boolean {
@ -17,7 +17,7 @@ export class KeyValueChangesFactory {
} }
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class KeyValueChanges extends Pipe { export class KeyValueChanges extends Pipe {
_records:Map; _records:Map;
@ -356,7 +356,7 @@ export class KeyValueChanges extends Pipe {
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class KVChangeRecord { export class KVChangeRecord {
key; key;

View File

@ -2,7 +2,7 @@ import {isBlank} from 'angular2/src/facade/lang';
import {Pipe, NO_CHANGE} from './pipe'; import {Pipe, NO_CHANGE} from './pipe';
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class NullPipeFactory { export class NullPipeFactory {
supports(obj):boolean { supports(obj):boolean {
@ -15,7 +15,7 @@ export class NullPipeFactory {
} }
/** /**
* @publicModule angular2/pipes * @exportedAs angular2/pipes
*/ */
export class NullPipe extends Pipe { export class NullPipe extends Pipe {
called:boolean; called:boolean;

View File

@ -1,7 +1,7 @@
export var NO_CHANGE = new Object(); export var NO_CHANGE = new Object();
/** /**
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
export class Pipe { export class Pipe {
supports(obj):boolean {return false;} supports(obj):boolean {return false;}

View File

@ -232,7 +232,7 @@ import {Injectable} from 'angular2/di';
* This directive would be instantiated with a `Dependency` directive found on the current element. If none can be * This directive would be instantiated with a `Dependency` directive found on the current element. If none can be
* found, the injector supplies `null` instead of throwing an error. * found, the injector supplies `null` instead of throwing an error.
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
@ABSTRACT() @ABSTRACT()
export class Directive extends Injectable { export class Directive extends Injectable {
@ -478,7 +478,7 @@ export class Directive extends Injectable {
* } * }
* ``` * ```
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class Component extends Directive { export class Component extends Directive {
/** /**
@ -614,7 +614,7 @@ export class Component extends Directive {
* *
* *
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class DynamicComponent extends Directive { export class DynamicComponent extends Directive {
/** /**
@ -706,7 +706,7 @@ export class DynamicComponent extends Directive {
* <div tooltip="some text here"></div> * <div tooltip="some text here"></div>
* ``` * ```
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class Decorator extends Directive { export class Decorator extends Directive {
@ -832,7 +832,7 @@ export class Decorator extends Directive {
* view occurs on the second `<li></li>` which is a sibling to the `<template>` element. * view occurs on the second `<li></li>` which is a sibling to the `<template>` element.
* *
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class Viewport extends Directive { export class Viewport extends Directive {
@CONST() @CONST()
@ -874,7 +874,7 @@ export class Viewport extends Directive {
* } * }
* } * }
* ``` * ```
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export const onDestroy = "onDestroy"; export const onDestroy = "onDestroy";
@ -912,7 +912,7 @@ export const onDestroy = "onDestroy";
* } * }
* } * }
* ``` * ```
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export const onChange = "onChange"; export const onChange = "onChange";
@ -933,6 +933,6 @@ export const onChange = "onChange";
* *
* } * }
* ``` * ```
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export const onAllChangesDone = "onAllChangesDone"; export const onAllChangesDone = "onAllChangesDone";

View File

@ -29,7 +29,7 @@ import {ABSTRACT, CONST, Type} from 'angular2/src/facade/lang';
* } * }
* ``` * ```
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class View { export class View {
templateUrl:any; //string; templateUrl:any; //string;

View File

@ -40,7 +40,7 @@ import {DependencyAnnotation} from 'angular2/di';
* The `@Parent()` annotation in our constructor forces the injector to retrieve the dependency from the * The `@Parent()` annotation in our constructor forces the injector to retrieve the dependency from the
* parent element (even thought the current element could resolve it): Angular injects `dependency=1`. * parent element (even thought the current element could resolve it): Angular injects `dependency=1`.
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class Parent extends DependencyAnnotation { export class Parent extends DependencyAnnotation {
@CONST() @CONST()
@ -101,7 +101,7 @@ export class Parent extends DependencyAnnotation {
* *
* Angular injects `dependency=2`. * Angular injects `dependency=2`.
* *
* @publicModule angular2/annotations * @exportedAs angular2/annotations
*/ */
export class Ancestor extends DependencyAnnotation { export class Ancestor extends DependencyAnnotation {
@CONST() @CONST()

View File

@ -240,7 +240,7 @@ function _createVmZone(givenReporter:Function): VmTurnZone {
* *
* Returns a [Promise] with the application`s private [Injector]. * Returns a [Promise] with the application`s private [Injector].
* *
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
export function bootstrap(appComponentType: Type, export function bootstrap(appComponentType: Type,
componentInjectableBindings: List<Binding> = null, componentInjectableBindings: List<Binding> = null,

View File

@ -1,5 +1,5 @@
/** /**
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
export class OnChange { export class OnChange {
onChange(changes) { onChange(changes) {

View File

@ -9,7 +9,7 @@ import {DirectDomViewRef} from 'angular2/src/render/dom/direct_dom_renderer';
* Attention: NgElement will be replaced by a different concept * Attention: NgElement will be replaced by a different concept
* for accessing an element in a way that is compatible with the render layer. * for accessing an element in a way that is compatible with the render layer.
* *
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
export class NgElement { export class NgElement {
_view:viewModule.AppView; _view:viewModule.AppView;

View File

@ -13,7 +13,7 @@ import * as renderApi from 'angular2/src/render/api';
/** /**
* Const of making objects: http://jsperf.com/instantiate-size-of-object * Const of making objects: http://jsperf.com/instantiate-size-of-object
* *
* @publicModule angular2/template * @exportedAs angular2/template
*/ */
@IMPLEMENTS(ChangeDispatcher) @IMPLEMENTS(ChangeDispatcher)
// TODO(tbosch): this is not supported in dart2js (no '.' is allowed) // TODO(tbosch): this is not supported in dart2js (no '.' is allowed)
@ -288,7 +288,7 @@ export class AppView {
/** /**
* *
* @publicModule angular2/template * @exportedAs angular2/template
*/ */
export class AppProtoView { export class AppProtoView {
elementBinders:List<ElementBinder>; elementBinders:List<ElementBinder>;

View File

@ -9,7 +9,7 @@ import * as viewModule from './view';
import * as vfModule from './view_factory'; import * as vfModule from './view_factory';
/** /**
* @publicModule angular2/template * @exportedAs angular2/template
*/ */
export class ViewContainer { export class ViewContainer {
render:renderApi.ViewContainerRef; render:renderApi.ViewContainerRef;

View File

@ -3,7 +3,7 @@ import {isPresent, print} from 'angular2/src/facade/lang';
import {ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection'; import {ListWrapper, isListLikeIterable} from 'angular2/src/facade/collection';
/** /**
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
@Injectable() @Injectable()
export class ExceptionHandler { export class ExceptionHandler {

View File

@ -5,7 +5,7 @@ import {ExceptionHandler} from 'angular2/src/core/exception_handler';
import {isPresent} from 'angular2/src/facade/lang'; import {isPresent} from 'angular2/src/facade/lang';
/** /**
* @publicModule angular2/change_detection * @exportedAs angular2/change_detection
*/ */
@Injectable() @Injectable()
export class LifeCycle { export class LifeCycle {

View File

@ -34,7 +34,7 @@ import {ListWrapper} from 'angular2/src/facade/collection';
* - `<li template="for #item of items; #i=index">...</li>` * - `<li template="for #item of items; #i=index">...</li>`
* - `<template [for]="#item" [of]="items" #i="index"><li>...</li></template>` * - `<template [for]="#item" [of]="items" #i="index"><li>...</li></template>`
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Viewport({ @Viewport({
selector: '[for][of]', selector: '[for][of]',

View File

@ -22,7 +22,7 @@ import {isBlank} from 'angular2/src/facade/lang';
* - `<div template="if condition">...</div>` * - `<div template="if condition">...</div>`
* - `<template [if]="condition"><div>...</div></template>` * - `<template [if]="condition"><div>...</div></template>`
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Viewport({ @Viewport({
selector: '[if]', selector: '[if]',

View File

@ -13,7 +13,7 @@ import {Decorator} from 'angular2/src/core/annotations/annotations';
* <div non-bindable>Ignored: {{1 + 2}}</div> // output "Ignored: {{1 + 2}}" * <div non-bindable>Ignored: {{1 + 2}}</div> // output "Ignored: {{1 + 2}}"
* ``` * ```
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Decorator({ @Decorator({
selector: '[non-bindable]', selector: '[non-bindable]',

View File

@ -29,7 +29,7 @@ import {Parent} from 'angular2/src/core/annotations/visibility';
* </ANY> * </ANY>
* ``` * ```
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Decorator({ @Decorator({
selector: '[switch]', selector: '[switch]',
@ -142,7 +142,7 @@ export class Switch {
* <template [switch-when]="'stringValue'">...</template> * <template [switch-when]="'stringValue'">...</template>
* ``` * ```
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Viewport({ @Viewport({
selector: '[switch-when]', selector: '[switch-when]',
@ -179,10 +179,10 @@ export class SwitchWhen {
* ``` * ```
* <template [switch-default]>...</template> * <template [switch-default]>...</template>
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
* ``` * ```
* *
* @publicModule angular2/directives * @exportedAs angular2/directives
*/ */
@Viewport({ @Viewport({
selector: '[switch-default]' selector: '[switch-default]'

View File

@ -11,7 +11,7 @@ import {Validators} from './validators';
//} //}
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
@Decorator({ @Decorator({
selector: '[control]', selector: '[control]',
@ -35,7 +35,7 @@ export class DefaultValueAccessor {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
@Decorator({ @Decorator({
selector: 'input[type=checkbox][control]', selector: 'input[type=checkbox][control]',
@ -59,7 +59,7 @@ export class CheckboxControlValueAccessor {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
@Decorator({ @Decorator({
lifecycle: [onChange], lifecycle: [onChange],
@ -119,7 +119,7 @@ export class ControlDirective {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
@Decorator({ @Decorator({
selector: '[control-group]', selector: '[control-group]',
@ -170,7 +170,7 @@ export class ControlGroupDirective {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
// todo(misko): rename to lover case as it is not a Type but a var. // todo(misko): rename to lover case as it is not a Type but a var.
export var FormDirectives = [ export var FormDirectives = [

View File

@ -4,7 +4,7 @@ import * as modelModule from './model';
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class FormBuilder { export class FormBuilder {
group(controlsConfig, extra = null):modelModule.ControlGroup { group(controlsConfig, extra = null):modelModule.ControlGroup {

View File

@ -4,12 +4,12 @@ import {StringMap, StringMapWrapper, ListWrapper, List} from 'angular2/src/facad
import {Validators} from './validators'; import {Validators} from './validators';
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export const VALID = "VALID"; export const VALID = "VALID";
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export const INVALID = "INVALID"; export const INVALID = "INVALID";
@ -26,7 +26,7 @@ export const INVALID = "INVALID";
//} //}
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class AbstractControl { export class AbstractControl {
_value:any; _value:any;
@ -80,7 +80,7 @@ export class AbstractControl {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class Control extends AbstractControl { export class Control extends AbstractControl {
constructor(value:any, validator:Function = Validators.nullValidator) { constructor(value:any, validator:Function = Validators.nullValidator) {
@ -108,7 +108,7 @@ export class Control extends AbstractControl {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class ControlGroup extends AbstractControl { export class ControlGroup extends AbstractControl {
controls:StringMap; controls:StringMap;
@ -186,7 +186,7 @@ export class ControlGroup extends AbstractControl {
} }
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class ControlArray extends AbstractControl { export class ControlArray extends AbstractControl {
controls:List; controls:List;

View File

@ -4,7 +4,7 @@ import {List, ListWrapper, StringMapWrapper} from 'angular2/src/facade/collectio
import * as modelModule from './model'; import * as modelModule from './model';
/** /**
* @publicModule angular2/forms * @exportedAs angular2/forms
*/ */
export class Validators { export class Validators {
static required(c:modelModule.Control) { static required(c:modelModule.Control) {

View File

@ -11,7 +11,7 @@ import {UrlResolver} from 'angular2/src/services/url_resolver';
/** /**
* Strategy to load component templates. * Strategy to load component templates.
* @publicModule angular2/angular2 * @exportedAs angular2/angular2
*/ */
@Injectable() @Injectable()
export class TemplateLoader { export class TemplateLoader {

View File

@ -46,7 +46,7 @@ import * as rvf from 'angular2/src/render/dom/view/view_factory';
* *
* This must be kept in sync with the _rootBindings in application.js * This must be kept in sync with the _rootBindings in application.js
* *
* @returns {*[]} * @returns {any[]}
*/ */
function _getRootBindings() { function _getRootBindings() {
return [ return [
@ -59,7 +59,7 @@ function _getRootBindings() {
* *
* This must be kept in sync with _injectorBindings() in application.js * This must be kept in sync with _injectorBindings() in application.js
* *
* @returns {*[]} * @returns {any[]}
*/ */
function _getAppBindings() { function _getAppBindings() {
var appDoc; var appDoc;

6
modules/angular2/template.js vendored Normal file
View File

@ -0,0 +1,6 @@
/**
* @module
* @public
* @description
* Define public API for Angular here.
*/

View File

@ -1,3 +1,6 @@
/** /**
* @module
* @public
* @description
* Define public API for Angular here. * Define public API for Angular here.
*/ */