Since i can't edit my previous post i'm writting here.
I created this code with the route but it won't work, when i select the
second tab it won't show the web page i want and when i select the initial
one it also returns me the same error.
This is my code:
/* Application */
var dashboardApp = angular.module("dashboardApp", ['ngRoute',
'dashboardServices', 'nvd3ChartDirectives']);
/* Route */
dashboardApp.config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/tab/one', {
templateUrl: 'partials/tab0.htm',
controller: 'DashboardCtrl'
}).
when('/tab/two', {
templateUrl: 'partials/tab1.htm',
controller: 'DashboardCtrl'
}).
otherwise({
redirectTo: '/tab/one'
});
} ]);
/* Service */
var dashboardServices = angular.module('dashboardServices', ['ngResource']);
dashboardServices.factory('Dash', ['$resource',
function ($resource) {
return $resource('http://localhost:9000/json', {}, {
query: {
method: 'GET',
isArray: true
}
});
}
]);
/* Controller */
function DashboardCtrl($scope, Dash) {
console.log('dashboard ctrl');
$scope.xFunction = function () { return function (d) { return d.key; };
};
$scope.yFunction = function () { return function (d) { return d.y; }; };
$scope.graficos = [];
Dash.query(function (data) {
var a = 0;
for (var j = 0; j < data.length; j++) { //nº de sectores
for (var i = 0; i < data[j].values.length; i++) { //nº de
graficos em cada sector
$scope.graficos[a] = [];
for (var x = 0; x < data[j].values[i].chartData.length;
x++) //valores de cada grafico
$scope.graficos[a][x] = data[j].values[i].chartData[x];
a++;
}
}
if (data[data.length - 1].key == "Comparativo") {
/*Bar Charts*/
$("div.DivRight").attr("class", "HiddenDivRight");
$("div.DivRightCima").attr("class", "HiddenDivRightCima");
$("div.DivRightBaixo").attr("class", "HiddenDivRightBaixo");
$("div.DivRightPanel").attr("class", "HiddenDivRightPanel");
/*Pie Charts*/
$("div.DivCentral").attr("class", "HiddenDivCentral");
$("div.DivCentralRight").attr("class", "HiddenDivCentralRight");
$("div.DivCentralLeft").attr("class", "HiddenDivCentralLeft");
$("div.DivCentralBaixo").attr("class", "HiddenDivCentralBaixo");
$("div.DivCentralPanel").attr("class", "HiddenDivCentralPanel");
$("div.LeftPieChart").attr("class", "HiddenLeftPieChart");
$("div.RightPieChart").attr("class", "HiddenRightPieChart");
}
});
}
and the error i get according with fiddler debugger is HTTP/1.1 404 Not
Found
has for chrome it returns me this
1. GET http://localhost:49681/tab/two 404 (Not Found)
jquery-1.9.0.min.js:3
1. sendjquery-1.9.0.min.js:3
2. st.extend.ajaxjquery-1.9.0.min.js:3
3. t.widget.loadjquery-ui-1.10.4.min.js:7
4. (anonymous function)jquery-ui-1.10.4.min.js:6
5. t.widget._eventHandlerjquery-ui-1.10.4.min.js:7
6. (anonymous function)jquery-ui-1.10.4.min.js:6
7. hjquery-ui-1.10.4.min.js:6
8. st.event.dispatchjquery-1.9.0.min.js:2
9. y.handle
Can anyone help me?
Thk
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.