jrief / django-angular

Let AngularJS play well with Django
http://django-angular.awesto.com/
MIT License
1.23k stars 294 forks source link

[$injector:unpr] Unknown provider: djangoRMIProvider #252

Closed Luancem closed 8 years ago

Luancem commented 8 years ago

hello, I'm coverting my project from Django&jQuery to Angular&Django. But I encountered an issue. could you help me? Thank you.

Copied my code here: url.py _from django.views.generic import TemplateView url(r'^navigation', TemplateView.as_view(templatename='navigation.html')), views.py _class MyJsonView(JSONResponseMixin, View): template_name = "navigation.html"
@allow_remoteinvocation def navigation(self): data={"name":"Luancem"} return data controller.js(implenmented the controller TreeController defined in html) _(function (ng) { var app = ng.module('tree', ['tree.directives']); var tags = '{% djng_allrmi %}'; app.config(function (djangoRMIProvider) { djangoRMIProvider.configure(tags); }); app.controller("TreeController", function ($scope, djangoRMI) { ... ... })(angular);

Follow the user guide, I am not sure where should {% load djng_tags %} write in html or controller.js? When I write it in html, it reports [$injector:unpr] Unknown provider: djangoRMIProvider

adrienbrunet commented 8 years ago

Hi, there is a dedicated tag on stackoverflow for that kind of question. This does not relate directly with the implementation of this library, does it? I feel you're missing the injection dependency 'djng.rmi'

Please refer to the docs to see how modules are injected. (see the {% ng_module_dependencies %} tag in the examples.

Feel free to reopen the issue if you find something wrong in our library. Happy to know django-angular can help you somehow. Cheers.

elongq commented 8 years ago

Hi adrienbrunet, Sorry to still ask you some basic questions. Our code is as below, but there is an error indicate that the djangoRMI is null. Very appreciated if you can help.

Below code is added into our html and we have referred to the django-angular.js and also add related code in views.py see the info from luancem but we still get errors.

{% load djng_tags %}

Githubissues.
  • Githubissues is a development platform for aggregating issues.