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

Recipes & Plugins #149

Closed
jadjoubran opened this issue Jan 21, 2016 · 6 comments
Closed

Recipes & Plugins #149

jadjoubran opened this issue Jan 21, 2016 · 6 comments

Comments

@jadjoubran
Copy link
Owner

As forecasted on the trello board this starter requires some kind of recipes.

After giving it some thought, it seems that what we might need is the following:

  1. Recipes
  2. Plugins

Recipes

Recipes would allow you to achieve common tasks by following a set of simple instructions. For example #147 and #148

Show validation messages in forms:

npm install angular-messages
add module to main.js
link to angular-messages docs

Internationalization for your app:

npm install angular-translate
add module to main.js
link to angular-translate docs

Plugins

Plugins are also not included out of the box in the repository, and allow you to follow a set of installation steps (usually involving your backend and/or front-end).
Check out the plugins column on the trello board for examples.

Another reason why I'm thinking of such approach, is that this repository does not intend to depend on way too many unused packages. Even if it was a font package, we don't include material-design-icons out of the box, because some users might be used to font-awesome (and so on..).

For now, it seems that recipes are defintely needed whereas the exact use cases of plugins is still vague.. So I'll probably start with recipes as of version 3.1

The best place for recipes, would probably be the documentation

I'd love to get feedback on this 😄

@shiruken1
Copy link
Contributor

Will there be documentation on how to write these recipes? I'd love to chip in with the localization, and others.

@jadjoubran
Copy link
Owner Author

Hi @shiruken1
Thank you for your interest!

For now, you can just create a new issue or comment here.. You can write it in Markdown comment and I'll port it to the relevant documentation page 😄

@shiruken1
Copy link
Contributor

@jadjoubran Should I paste the contents of the files here, or does this link suffice? Localization

The main components are:

  • App/Helpers/Translations::translate() The main code to convert the JSON's, and the function you'll need to call from any back-end method besides a controller
  • App/Http/Controllers/Controller::d() the wrapper for controllers to use
  • Angular/config/translate.config.js (What tells angular-translate to look for the json files as soon as you change states)
  • public/lang/{en}/*.json (The json files under the respective locale designator 'en', in this case)

Translate.config.js will automatically try to load the name of the state with the .json extension, without the "app." prefix. For example, if you've clicked/loaded the login page, and it's state is defined as app.login in the routes.js file, angular-translate will look for "public/lang/en/login.json"

When using it from a blade view (for example, when emailing something), all you'll need to code is:

@inject('T', 'App\Helpers\Translations')
<p>{{ $T->translate('EMAIL_GREETING', '', 'email', 'en') }}</p>

Translations::translate(), in this use case, will look for the EMAIL_GREETING key "public/lang/en/email.json"

@jadjoubran Let me know if I should include anything else!

@jadjoubran
Copy link
Owner Author

Thanks @shiruken1
I'll check this in the coming week (or two)
I will of course extract the necessary files from your repo so that we make sure this solution will always work
I will also prepare the documentation setup for this
Thanks again 😄

@jadjoubran
Copy link
Owner Author

jadjoubran commented May 11, 2016

@jadjoubran
Copy link
Owner Author

https://github.com/jadjoubran/laravel-angular-recipes

So I thought about starting with an easy way (github repo for instance) and then once we have a lot of recipes and other features such as search and voting (etc.) are required, I will develop a separate page/website

Let me know what you think! 😄
And feel free to send your Recipes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants