Closed jrock2004 closed 10 years ago
if you look in the source of the html you get, do you see the controllers/testcases.js
file being loaded?
Well, when I load localhost:3000/testcases, I get an routes error page that has
Cannot GET /testcases
oh, did you add the testcases
resource in the back/resource
folder?
i assume testcases
is a new entity in your web app.
When you create an api-endpoint for it, synth will also add a front route for it.
Do I create it manually or is there a synth command to do it?
you create it manually :)
when you run synth s
synth will generate end-points and routes for your web app (using express
).
The end-points and routes generated is based on the file/folders present in your front
and back
folders within the synth project.
Make a file at back/resources/testcases/index.js
In there declare a request handler:
exports.getIndex = function () {
return {
testcases: []
};
};
On Fri, Sep 26, 2014 at 1:18 PM, Mikael Møller notifications@github.com wrote:
you create it manually :) when you run
synth s
synth will generate end-points and routes for your web app (usingexpress
). The end-points and routes generated is based on the file/folders present in yourfront
andback
folders within the synth project.
Reply to this email directly or view it on GitHub: https://github.com/JonAbrams/synth/issues/76#issuecomment-57014785
Just started learning this tool and for the life of me, I cannot get a new controller created. This is what I did to create a controller:
front-app.js
$routeProvider .when('/tweets', { templateUrl: '/html/tweets/getIndex.html', controller: 'tweetsController', resolve: { data: dataLoaderRunner } }) .when('/testcases', { templateUrl: '/html/testcases/getIndex.html', controller: 'testcasesController', resolve: { data: dataLoaderRunner } }) .otherwise({ redirectTo: '/tweets' });
jsFiles I added
controllers/testcases.js
js/controllers/testcases.js
angular.module('automation_dashboard') .controller('testcasesController', function ($scope, data) { $scope.tweets = data.tweets; });
Thoughts?