From c376a7426614613765847837833df857d05094a1 Mon Sep 17 00:00:00 2001 From: Edgar Mueller Date: Mon, 4 Apr 2016 16:54:45 +0200 Subject: [PATCH] Fixes #212: add navbar to navigate examples --- examples/app/app.js | 30 +++++++------------ examples/app/index/index.controller.js | 13 ++++++++ examples/embed-index.html | 41 ++++++++++++++++++++++---- 3 files changed, 59 insertions(+), 25 deletions(-) create mode 100644 examples/app/index/index.controller.js diff --git a/examples/app/app.js b/examples/app/app.js index 2bd9813d0..b13048b51 100644 --- a/examples/app/app.js +++ b/examples/app/app.js @@ -11,53 +11,43 @@ angular.module('makeithappen', [ templateUrl: 'app/local/local.html', controller: 'LocalController', controllerAs: 'vm' - }); - $routeProvider.when('/editor', { + }).when('/editor', { templateUrl: 'app/editor/editor.html', controller: 'EditorController', controllerAs: 'vm' - }); - $routeProvider.when('/custom', { + }).when('/custom', { templateUrl: 'app/custom/custom.html', controller: 'CustomController', controllerAs: 'vm' - }); - $routeProvider.when('/defaultui', { + }).when('/defaultui', { templateUrl: 'app/default-ui/defaultui.html', controller: 'DefaultUISchemaController', controllerAs: 'vm' - }); - $routeProvider.when('/defaultschema', { + }).when('/defaultschema', { templateUrl: 'app/default/default-schema.html', controller: 'DefaultSchemaController', controllerAs: 'vm' - }); - $routeProvider.when('/placeholder-posts/:id?', { + }).when('/placeholder-posts/:id?', { templateUrl: 'app/placeholder/placeholder-posts.html', controller: 'PlaceholderController', controllerAs: 'vm' - }); - $routeProvider.when('/placeholder-users/:id?', { + }).when('/placeholder-users/:id?', { templateUrl: 'app/placeholder/placeholder-users.html', controller: 'PlaceholderController', controllerAs: 'vm' - }); - $routeProvider.when('/placeholder-comments/:id?', { + }).when('/placeholder-comments/:id?', { templateUrl: 'app/placeholder/placeholder-comments.html', controller: 'PlaceholderController', controllerAs: 'vm' - }); - $routeProvider.when('/polymer', { + }).when('/polymer', { templateUrl: 'app/polymer/polymer.html', controller: 'PolymerController', controllerAs: 'vm' - }); - $routeProvider.when('/arrays', { + }).when('/arrays', { templateUrl: 'app/arrays/arrays.html', controller: 'ArraysController', controllerAs: 'vm' - }); - $routeProvider.otherwise({ + }).otherwise({ redirectTo: '/local' }); } diff --git a/examples/app/index/index.controller.js b/examples/app/index/index.controller.js new file mode 100644 index 000000000..77215978c --- /dev/null +++ b/examples/app/index/index.controller.js @@ -0,0 +1,13 @@ +'use strict'; + +angular.module('makeithappen').controller('IndexController', function($scope, $location) { + + var vm = this; + vm.isActive = function(fragment) { + if (fragment == $location.path()) { + return 'active'; + } else { + return 'inactive'; + } + } +}); \ No newline at end of file diff --git a/examples/embed-index.html b/examples/embed-index.html index 254310160..bc83cdb2b 100644 --- a/examples/embed-index.html +++ b/examples/embed-index.html @@ -15,13 +15,17 @@ - - + + + + @@ -67,11 +72,37 @@ -
+
+ + +
-

JSON Forms Demo

-
+