setrretirement.blogg.se

Layouteditor move to anther layer
Layouteditor move to anther layer






I made it a point to break it down so that we had exactly one file per component.

LAYOUTEDITOR MOVE TO ANTHER LAYER CODE

This file contained all controllers, services, directives, and code specific to each controller. Organizing a code baseĪnother illness we had to deal with during our migration, was that the entire code-base was crammed together in a single large file. Sortable, on the other hand, just depends on jQuery UI. The drag and drop problem has been solved, we could (and probably should) be using angular-dragon-drop, which is a really simple drag and drop implementation. But dragging, drag and drop, and, in particular, being able to drag something and drop it in a sorted list, is just something that involves a lot of work if you’re not using jQuery UI there is no real alternative. We’re clearly not using it just for the sake of dialogs, we have directives for that. We have a dependency on jQuery UI, which I’m not pleased about. We created directives that manipulate the DOM, and use angular.element, even if it just maps to jQuery today. Doing so simplified every controller we went through. It was still worthwhile to remove as much jQuery spam as possible. We have other, more important goals in place, such as releasing the product. I won’t sit here and claim we’ve managed to remove jQuery altogether. If you minify your code using a minifier without running ngmin first, you’re going to have a bad time. Most of the examples in the documentation are treated as if you don’t really need the Array form, but the thing is, you do. This is the one thing that I don’t like in Angular, and it’s probably the documentation’s fault. Most of the module API, on the other hand, allows you to pass either a function or an Array containing the list of dependencies, followed by the function that depends on those. You might’ve noticed that in the earliest example, dependencies are injected using $inject.

layouteditor move to anther layer

Var LoginCtrl = function ($scope, dep1, dep2) )(). If you’re familiar with Angular, you might be familiar with this pattern, too. This one is, sadly, pretty common amongst folks who’ve been using Angular since the early days. In this article, I’ll discuss some of those issues and how we overcame them.

layouteditor move to anther layer

The wrong way, in our case, encompassed quite a few issues we had to work through before getting to the lovable state our code-base is in at the moment.






Layouteditor move to anther layer