From 5176a10b45f4738011f1bb379a1b7bdb897843fd Mon Sep 17 00:00:00 2001 From: GloriousCode Date: Sat, 23 Jul 2016 12:55:58 +1000 Subject: [PATCH] I should have it now. But cannot check it out due to lack of CDN connetivity --- .gitignore | 4 +++- web/glorious-web/app.js | 3 +-- web/glorious-web/controllers.js | 23 ++++++++++++++++++++++ web/glorious-web/index.js | 9 +++++++++ web/glorious-web/views/pages/index.ejs | 8 ++++---- web/glorious-web/views/partials/footer.ejs | 2 +- 6 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 web/glorious-web/controllers.js create mode 100644 web/glorious-web/index.js diff --git a/.gitignore b/.gitignore index 0cffcb34..f2403fc4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -config.json \ No newline at end of file +config.json +node_modules +lib diff --git a/web/glorious-web/app.js b/web/glorious-web/app.js index e52f19f3..55c994ec 100644 --- a/web/glorious-web/app.js +++ b/web/glorious-web/app.js @@ -3,8 +3,7 @@ // Declare app level module which depends on views, and components angular.module('gocryptoweb', [ 'ngRoute', - 'gocryptoweb.view1', - 'gocryptoweb.view2' + 'gocryptoweb.controllers' ]). config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) { $locationProvider.hashPrefix('!'); diff --git a/web/glorious-web/controllers.js b/web/glorious-web/controllers.js new file mode 100644 index 00000000..ea84afdc --- /dev/null +++ b/web/glorious-web/controllers.js @@ -0,0 +1,23 @@ +'use strict'; + +/* Controllers */ + +angular.module('gocryptoweb.controllers', []). + controller('HomeController', function ($scope, $http) { + $scope.working = true; + $http({ + method: 'GET', + url: '/data/all-enabled-currencies' + }). + success(function (data, status, headers, config) { + $scope.exchanges = data.data.exchanges; + }). + error(function (data, status, headers, config) { + console.log('error'); + }); + + }). + controller('MyCtrl1', function ($scope) { + // write Ctrl here + + }); diff --git a/web/glorious-web/index.js b/web/glorious-web/index.js new file mode 100644 index 00000000..218da370 --- /dev/null +++ b/web/glorious-web/index.js @@ -0,0 +1,9 @@ + +exports.index = function(req, res){ + res.render('index'); +}; + +exports.partials = function (req, res) { + var name = req.params.name; + res.render('partials/' + name); +}; \ No newline at end of file diff --git a/web/glorious-web/views/pages/index.ejs b/web/glorious-web/views/pages/index.ejs index dc80b817..ff23f2f1 100644 --- a/web/glorious-web/views/pages/index.ejs +++ b/web/glorious-web/views/pages/index.ejs @@ -1,7 +1,7 @@ - + <% include ../partials/head %> @@ -12,9 +12,9 @@
-
-

Hello world!

- +
+ + {{working}}
diff --git a/web/glorious-web/views/partials/footer.ejs b/web/glorious-web/views/partials/footer.ejs index 4d4d8d41..55675996 100644 --- a/web/glorious-web/views/partials/footer.ejs +++ b/web/glorious-web/views/partials/footer.ejs @@ -1,3 +1,3 @@ -

© Copyright 2016 GoCrypto Trader

\ No newline at end of file +

Copyright 2016 GoCrypto Trader

\ No newline at end of file