/*
 *    Copyright (C) 2010 - 2015 VREM Software Development <VREMSoftwareDevelopment@gmail.com>
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */
angular.module('BWMonApp.DisplayType', [])
.directive('displayType', function() {
	return {
		restrict: 'E',
		replace: true,
		require: ['ngModel'],
		scope: {
			displayType: '=ngModel',
		},
		template: '<button id="buttonShowChart" class="btn btn-primary" ng-click="displayType=!displayType">'+
			'<span ng-if="!displayType">Show Chart</span>'+
			'<span ng-if="displayType">Show Data</span>'+
			'</button>'
	};
});

@@ -835,52 +835,8 @@
 ,%0A%09%09
-scope: %7B%0A%09%09%09displayType: '=ngModel',%0A%09%09%7D,%0A%09%09
 temp
@@ -841,16 +841,22 @@
 mplate: 
+%5B%0A%09%09%09%09
 '%3Cbutton
@@ -911,16 +911,21 @@
 -click=%22
+ctrl.
 displayT
@@ -931,10 +931,17 @@
 Type
-=!
+ = !ctrl.
 disp
@@ -950,21 +950,23 @@
 yType%22%3E'
-+%0A
+,%0A%09
 %09%09%09
+%09
 '%3Cspan n
@@ -972,16 +972,21 @@
 ng-if=%22!
+ctrl.
 displayT
@@ -1004,26 +1004,28 @@
 hart%3C/span%3E'
-+%0A
+,%0A%09%09
 %09%09%09'%3Cspan ng
@@ -1029,16 +1029,21 @@
  ng-if=%22
+ctrl.
 displayT
@@ -1068,10 +1068,11 @@
 an%3E'
-+%0A
+,%0A%09
 %09%09%09'
@@ -1082,16 +1082,151 @@
 utton%3E'%0A
+%09%09%09%5D.join(''),%0A%09%09scope: %7B%7D,%0A%09%09bindToController: %7B%0A%09%09%09displayType: '=ngModel',%0A%09%09%7D,%0A%09%09controller: function() %7B%7D,%0A%09%09controllerAs: 'ctrl'%0A
 %09%7D;%0A%7D);%0A

remove scope from display type directive