angularAMD icon indicating copy to clipboard operation
angularAMD copied to clipboard

Add ui-router/restangular example on webpage/readme

Open marcoslin opened this issue 11 years ago • 1 comments

ui-router/restangular seems to be popular with community.

marcoslin avatar Feb 19 '14 07:02 marcoslin

Just tested your module in my seed project with ui-router (thx for great work btw).

As for ui-router, it's basically the same, just different service names, defining states instead of "routes" and it seems you need to specify url attribute. E.g.:

app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {

    $urlRouterProvider.otherwise('/view1');

    $stateProvider
      .state('view1', angularAMD.route({
          url: '/view1',
          templateUrl: 'partials/partial1.html',
          controller: 'View1',
          controllerUrl: 'controllers/view1.ctrl'
        })
      )
      .state('view2', angularAMD.route({
          url: '/view2',
          templateUrl: 'partials/partial2.html',
          controller: 'View2',
          controllerUrl: 'controllers/view2.ctrl'
        })
      );

  }]);

For further and more complex states routing, one should refer to ui-router docs. :)

smajl avatar Mar 30 '14 17:03 smajl