Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add import information #12278

Merged
merged 1 commit into from
Jul 13, 2017
Merged

Add import information #12278

merged 1 commit into from
Jul 13, 2017

Conversation

b264
Copy link

@b264 b264 commented Jul 6, 2017

Cannot use ToastController without knowing from where to import it

Short description of what this resolves:

The doc is incomplete because this code won't work without first importing the class. This is a common occurrence across virtually all of the Ionic docs. This is the one that got me today, so I thought I'd fix it.

Changes proposed in this pull request:

  • add import to code example in doc

Cannot use ToastController without knowing from where to import it
@b264
Copy link
Author

b264 commented Jul 6, 2017

I had to find this offsite on https://alligator.io/ionic/toast-controller-ionic/

@AmitMY
Copy link
Contributor

AmitMY commented Jul 6, 2017

Thanks for this PR.
I don't believe this is really needed, as all of the imports are from ionic-angular.
Plus, most IDEs can auto import.

However, if you find this really needed, and a core member gives a green light for merging, this should be more complete, so it is needed in all components.

@brandyscarney
Copy link
Member

Thanks for the PR! @mhartington what do you think of adding the package name to the top of API docs, similar to how Angular does it: https://angular.io/api/common/isPlatformBrowser

It would be helpful for quickly differentiating between the Native API as well: http://ionicframework.com/docs/native/action-sheet/

@mhartington
Copy link
Contributor

This can be done. While this is pretty obvious to us (since we in the code day to day), it's helpful to have.

We could just add a sample import statement if that helps? Feel like thats a bit more useful than what the angular docs provide

@mhartington
Copy link
Contributor

Oh, and yeah, this looks good to merge

@brandyscarney
Copy link
Member

@mhartington I mostly meant some sort of sample import or reference to which package it comes from at the top of the API docs. The usage example is great too but it would be something that the user immediately sees when they visit each API doc. Something we could add to dgeni.

@brandyscarney brandyscarney merged commit d23b9f7 into ionic-team:master Jul 13, 2017
@b264 b264 deleted the patch-1 branch July 13, 2017 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants