fixed 'edit this form' button

This commit is contained in:
David Baldwynn 2015-11-11 12:29:16 -08:00
parent 71735f3bec
commit 4c21c176c2
4 changed files with 9 additions and 6 deletions

View file

@ -1,8 +1,8 @@
'use strict';
angular.module('core').controller('HomeController', ['$rootScope', '$scope', 'User', 'Auth', '$state',
function($rootScope, $scope, User, Auth, $state) {
angular.module('core').controller('HomeController', ['$rootScope', '$scope', 'User', '$state',
function($rootScope, $scope, User, $state) {
$scope = $rootScope;
}
]);

View file

@ -1,9 +1,9 @@
'use strict';
// Forms controller
angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScope', '$stateParams', '$state', 'Forms', 'CurrentForm', 'Auth', 'myForm',
function($scope, $rootScope, $stateParams, $state, Forms, CurrentForm, Auth, myForm) {
$scope.authentication = Auth;
angular.module('forms').controller('SubmitFormController', ['$scope', '$rootScope', '$state', 'myForm',
function($scope, $rootScope, $state, myForm) {
$scope.authentication = $rootScope.authentication;
$scope.myform = myForm;
if(!$scope.myform.isLive){

View file

@ -9,6 +9,8 @@ angular.module('forms').directive('submitFormDirective', ['$http', '$timeout', '
myform:'='
},
controller: function($scope){
$scope.authentication = $rootScope.authentication;
angular.element(document).ready(function() {
$scope.error = '';

View file

@ -61,7 +61,8 @@
</div>
<div class="hidden-xs hidden-sm col-md-6 col-md-offset-3 row">
<div class="col-md-4 col-md-offset-2" ng-if="!authentication.isAuthenticated()">
<a href="/#!/forms" class="btn btn-default">Create a NodeForm</a>
<a href="/#!/forms" class="btn btn-default">Create
a NodeForm</a>
</div>
<div class="col-md-4 col-md-offset-2" ng-if="authentication.isAuthenticated()" class="hidden-sm hidden-xs">
<a href="/#!/forms/{{myform._id}}/admin/create" class="btn btn-default">Edit this NodeForm</a>