G
G
georgeangst2015-02-07 00:25:31
Angular
georgeangst, 2015-02-07 00:25:31

How to implement routing in AngularJS if the view itself is obtained from the RequireJS module received by request?

I ran into a problem: from external *.json in $scope we get the structure by which ng-repeat displays tabs, each tab should display its own ui-view on click (I use angular ui-router).
The resulting *.json in each of the objects contains the "path" key with the value - a link to the "file.js" in which the type module is located:

define([
 'backbone'
], function(Bakbone) {
 return Backbone.View.extend({
  render: function() {
 this.$el.html('<div>test</div>');
 }
 });
});

this example uses Backbonejs, I need to implement similar functionality in Angularjs, I can’t understand the principle of processing the RequireJS module in conjunction with Angularjs, I haven’t seen this in practice and I don’t know where to dig. It turns out that before *.json is received, the possible states of the state are unknown.
I apologize if the question is asked incorrectly. First encountered Requirejs, rarely worked with Angularjs.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-02-07
Protko @Fesor

christopherthielen.github.io/ui-router-extras/exam...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question