Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(guides/directive): document the C and M directive options #5516

Closed
wants to merge 1 commit into from
Closed

docs(guides/directive): document the C and M directive options #5516

wants to merge 1 commit into from

Conversation

benmccann
Copy link
Contributor

I was looking at some code that had:

restrict: 'CA',

I had a super hard time figuring out what it did. It would be nice to mention this in the comments.

@caitp
Copy link
Contributor

caitp commented Dec 23, 2013

The meaning of these are documented, for instance at https://github.com/angular/angular.js/blob/master/docs/content/guide/directive.ngdoc#L286 (this is what your patch changes, but it's just a rough example/guide) and https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L205 (the specific API documentation)

The documentation generator understands these symbols, and uses them in creating examples (see http://docs.angularjs.org/api/ng.directive:ngClick for an example)

It might be good to link to the pertinent API docs from the guide, but I don't necessarily think it's good to duplicate the API docs in the guide, that's all

@benmccann
Copy link
Contributor Author

I think that's reasonable. I've added a link where I'd most expect one to appear

@caitp
Copy link
Contributor

caitp commented Jan 4, 2014

It's a docs fix, and as far as I can tell it's not incorrect or undesirable. Probably get looked at next week in the afternoon, at the latest.

@benmccann
Copy link
Contributor Author

thanks!

@caitp caitp closed this in 756c52d Jan 18, 2014
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
Originally, this issue was regarding documenting `restrict: 'CM'` in the directive guide, but it
was pointed out that the restrict documentation is covered in the $compile documentation. Because of
this, a link was simply added to the $compile documentation.

However, the wording suggests that it's actually linking to the directive registration function, in
$compileProvider, so the docs will link there instead. There is a link only a paragraph below to the
$compile documentation, so this does not hurt.

Closes angular#5516
jamesdaily pushed a commit to jamesdaily/angular.js that referenced this pull request Jan 27, 2014
Originally, this issue was regarding documenting `restrict: 'CM'` in the directive guide, but it
was pointed out that the restrict documentation is covered in the $compile documentation. Because of
this, a link was simply added to the $compile documentation.

However, the wording suggests that it's actually linking to the directive registration function, in
$compileProvider, so the docs will link there instead. There is a link only a paragraph below to the
$compile documentation, so this does not hurt.

Closes angular#5516
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants