Below is my HTML code along with JS script. I need to Change the value of "label" after the button click but it is not changing and using global values only.
http://plnkr.co/edit/T4EaZglOnq8Q2UVLWNFm?p=preview
My preview/Plnkr can be seen here..
JS CODE:
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.year1=1992;
$scope.year2=1994;
$scope.year3=1996;
$scope.label=[$scope.year1,$scope.year2,$scope.year3];
$scope.splitYears = function()
{
$scope.year1=2202;
$scope.year3=2004;
$scope.year2=2001;
$scope.checking=[$scope.year1,$scope.year2,$scope.year3];
}
$scope.checking1=[$scope.year1,$scope.year2,$scope.year3];
});