I am creating an application where I will create something similar to a wizzard of windows forms and for this I am using a routing as follows:
.state("vendaOrcamento", {
url: "/vendaOrcamento",
abstract:true,
templateUrl: "templates/comercial/vendaOrcamento.html"
})
.state('vendaOrcamento.cliente', {
url: "/cliente",
views: {
'tab-cliente': {
templateUrl: "templates/comercial/vendaOrcamento/1cliente.html"
}
}
})
.state('vendaOrcamento.produtos', {
url: "/produtos",
views: {
'tab-produtos': {
templateUrl: "templates/comercial/vendaOrcamento/2produtos.html"
}
}
})
I need both for the child client and for the child products to have a vendaOrcamento
global object, so regardless of which child I am, I will always be working with the same object without losing the previously treated data, I basically need this:
$scope.vendaOrcamento = {
cliente : {},
produtos : {}
}
My problem is that I did not understand very well how I can work like this, I even tried to create a Controller
directly in the parent view (saleOrcamento) but it did not work very well ... someone can give me a light please?