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

Isolate scope for constant template #36

Open
leandrocrs opened this issue Jul 15, 2016 · 2 comments
Open

Isolate scope for constant template #36

leandrocrs opened this issue Jul 15, 2016 · 2 comments
Milestone

Comments

@leandrocrs
Copy link

Use John Papas guide recommendation and isolate scope for constant.

@guzart
Copy link
Owner

guzart commented Aug 9, 2016

Hi, first of all thank you for your PR.

I added a options.wrapHeader and options.wrapFooter in the 2.0.0-1 pre-release that I think would make it easier to customise the output, let me know what you think?

Do you have a link to where in the style guide is the ;(function(){ header? I would like to set the defaults to match the style guide.

Thanks

@guzart guzart added this to the v2.0.0 milestone Aug 9, 2016
@Cordobo
Copy link

Cordobo commented Sep 26, 2016

I guess @leandrw refers to https://github.com/johnpapa/angular-styleguide/blob/master/a1/README.md#style-y240

without the first ; which one can accomplish with options.wrapHeader and options.wrapFooter or, if I remember right, wrap: true.

Just for reference:
I set wrap: false (I already have a gulp task for the IIFE) but I wanted to add 'use strict'; to the generated file viaoptions.wrapHeader, which did not work :) I solved it by using my own template:

'use strict';
angular.module('<%- moduleName %>')
<% constants.forEach(function(constant) { %>${indent}.constant('<%- constant.name %>', ${constant.value})<%= _.last(constants) === constant ? '' : '\n' %><% }) %>;

This solved another issue with the empty deps [] as well, as I already had the angular module declared in a separate file.

Update: Typo

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

No branches or pull requests

3 participants