Sha256: d065f99ea3244a51e1390b22fdb7dbbc78066e203a31e438e94998636dbf4625

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

angular.module("hyperadmin")
  .config ($locationProvider, $stateProvider, $urlRouterProvider) ->
    $locationProvider.html5Mode true

    $stateProvider
      .state "index",
        url: "/admin/:pluralName"
        templateUrl: (params) ->
          "/admin/#{params.pluralName}.html"
        controller: "IndexCtrl as indexCtrl"
        resolve:
          resourceClass: ($stateParams, Restangular) ->
            Restangular.one("admin/resource_classes", $stateParams.pluralName).get()
        data:
          resource: "resource"
      .state "index.new",
        url: "/new"
        templateUrl: (params) ->
          "/admin/#{params.pluralName}/new.html"
        controller: "NewCtrl as newCtrl"
        data:
          mode: "new"
      .state "index.show",
        url: "/:id"
        templateUrl: (params) ->
          "/admin/#{params.pluralName}/#{params.id}.html"
        controller: "ShowCtrl as showCtrl"
        data:
          resource: "resource"
      .state "index.edit",
        url: "/:id/edit"
        templateUrl: (params) ->
          "/admin/#{params.pluralName}/#{params.id}/edit.html"
        controller: "EditCtrl as editCtrl"
        data:
          resource: "resource"
          mode: "edit"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper_admin-0.4.0 app/assets/javascripts/hyper_admin/angularjs/states.js.coffee
hyper_admin-0.3.0 app/assets/javascripts/hyper_admin/angularjs/states.js.coffee