V
V
vasIvas2015-08-04 22:10:51
Angular
vasIvas, 2015-08-04 22:10:51

Do you stick to angular-styleguide or something else?

I saw the styleguide and was a little disappointed. That's not possible -

/* избегайте этого */
angular
    .module('app', ['ngRoute'])
    .controller('SomeController', SomeController)
    .factory('someFactory', someFactory);

/* рекомендовано */

// app.module.js
angular
    .module('app', ['ngRoute']);

And after seeing all this, I want to ask - is it right, especially if you use import from es6?
Personally, I have experience with very large projects that would not even be possible to run if initialization was not carried out in one place. The class turned out to be very large, but it was better than raking through the folders that you wrote, but at least bang your head on the table, when you see them, you feel like they were thrown to you.
Or do you, and even "some majority" have a different opinion?
And only now I remembered that quite recently this was explained to me. But there were words like - "I stick to the styleguide, but in the example it was the way it is not recommended. But this was also caused by using importa.
And so I think that there is no import, but I sincerely do not really want to do it as recommended.
But the question arises - can you suffer from this, because sooner or later someone will see your code?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2015-08-04
@vasIvas

There is no point in looking at this style guide if you use ES6, only in parts where specifically about how to build an architecture.
I have everything written like this:

export default angular.module('someStuff', [
  require('myDependency')
])
  .service('MyService', require('./service.js'))
  .name;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question