I need to know to access the variable ''x" from controller
Javascript
function myCtrl() {
var x =1;
}
Jasmine
describe("myCtrlsettings", function() {
var scope ;
var rootScope;
beforeEach(inject(function($rootScope, $controller) {
scope = $rootScope.$new();
ctrl = $controller("myCtrl", {
$scope: scope
});
}));
it(" Test ", function(){
expect(x).toBe(1); // what should I write here??
} );
});
how to access the variable ''x" from controller?
please help me