Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing same views (with controllers) for several areas
Message
De
06/05/2015 02:57:34
 
 
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01619445
Message ID:
01619453
Vues:
26
>Hi everybody,
>
>I am wondering what is the best way of sharing the same views between several areas?
>
>I have InvoicesList and I want to be able to present it from both Customer Accounts area and Guests Area. Originally Invoices (and all related functionality) was designed in the Customer Accounts area.
>
>Now I want to share it between these 2 areas.
>
>I moved and renamed the view. I named it InvoicesList and placed into Views/Shared folder in the project.
>
>In my controller js file I now have
>
>
>$stateProvider
>            .state('edit.invoices', {
>                url: '/invoices:invoiceId?accountNameHash?isNew',
>                views: {
>                    'invoices': {
>                        templateUrl: '/Views/Shared/InvoicesList',
>                        controller: 'invoicesSearchController'
>                    },
>                    'detail': {
>                        templateUrl: '/CustomerAccounts/Invoices/editForm',
>                        controller: 'invoicesCrudController'
>                    }
>                }
>            })
>
>In the AccountsController.cs I have now:
>
>
> [Route("InvoicesList")]
>        public ActionResult InvoicesList()
>        {
>            return PartialView();
>        }
>
>but it's not going hit.
>
>It should be something relatively simple I am missing here, I hope.
>
>Do you see what change should I make in order to get that view from the Shared place?
>
>Thanks in advance.

Is the 'detail' view being loaded ?
If so then maybe you don't have a correct ui-view for 'invoices' in the html for the parent view ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform