E
E
ErickSkrauch2014-02-25 18:37:12
JavaScript
ErickSkrauch, 2014-02-25 18:37:12

How to implement Angular.js dependency injection in an existing project?

Hello. There is already written and operating project. It uses Ajax for loading content and libraries that I wrote myself.

The UI is built in such a way (especially in those modules that are currently under development) that you have to invent a lot of code in jQuery. And then suddenly I found out about the wonderful Angular.js framework, with its data binding.

And here I had a problem: I have routing through pushState (), that is, without this "#!". Convert to Angular - yes, the option is not bad, but I would like to keep the current structure, because changing the model inference algorithm is a big time investment (I am writing one). However, I would still really like to have Angular.js in my arsenal.

You can see how it works in my profile on the site.

Please help, I don't know how to google it.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lega, 2014-02-26
@ErickSkrauch

Look at Angular Light, it can be more convenient for embedding into a ready-made "structure".

R
Ruslan Lopatin, 2014-02-25
@lorus

AngularJS supports the HTML5 History API. It is enough to set up $locationProvider:
$locationProvider.html5Mode(true);

A
Anton, 2014-02-25
@sHinE

Somehow, in the plugin for tinyMce, I accessed a service created through a factory like this:
those. through the injector you can reach your angular services and built-in functions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question