L
L
Loot2015-10-28 00:07:21
Angular
Loot, 2015-10-28 00:07:21

What tasks would you give to a beginner angular developer?

Question above. And what tasks did you do when you first started?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-10-28
@Cesavel

And what tasks did you do when you first started?

I was given the opportunity to remember angular (1.0 yet), 2 weeks to study it and the project to be done ... and I had to do it ... it was fun)
In general, in addition to "pull up JS before this", now I would also recommend babel. js, without it I can’t imagine how you can write supported JS code (you can, of course, but it’s more trite). You also need a convenient build system - I recommend webpack, as it is easier to start with and it forces you to use modules. I recommend this skeleton project. Well, a nice side effect, your services will not directly know that they are used in the context of angular.
As for Angular - for starters, I would recommend reading the documentation, angular styleguide, etc. At least a week. I also recommend using TDD with it (it’s unit tests with mocks of all dependencies, if it’s hard to write tests, you need to figure out how to make it easier, for example, mock not http, but a service, etc.), especially good when learning. It makes it very easy to find weaknesses in your application architecture and also makes it easier to change it.
If you accept a couple of simple rules for yourself, ala "try to use less often everything with a dollar sign directly", do not shove $scope into controllers, in general there are less dependencies on angular for your services, try not to use link in directives (well, or do it only for what it is needed - for binding the directive and the DOM, monitoring attributes and calling the controller of the directive, etc.), then life will become a little easier. Then Angular itself will become a little easier. Well, yes, do not use independent controllers at all (neither ng-controller nor controllers for ngRoute routes nor for uiRouter, generally look towards angular / router)
By tasks.... I would recommend to write more various components (directives) that you may need. For example, since I mostly make admins in angular, various UI components that can be reused are useful to me, for example, filters for lists. This is a good exercise in my opinion, because... your components don't need to know anything about how we store data or what we plan to do with it. There you can play around with transclusions, and with dependencies between directives, etc.
Next, deal with modules, services, service factories ... how in general can your services be registered in the angular dependency container. For this, some tasks may come up, ala ... a service for organizing authorization. First, implement it, then try to make it reusable by transferring the initial configuration to the provider and passing the settings to the service constructor ... well, something like that in a word.
And then implement some apu. And it’s better together, we wrote directives, tried to use them. Uncomfortable - we drink further.

K
Konstantin Kitmanov, 2015-10-28
@k12th

Write unit tests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question