Q:

The line before a $timeout is not working (angularjs)

I have 
vm.showSuccess = true;
$timeout(function() { close(); }, 2000);
vm.showSuccess = false;

The timeout function works fine, but the first line does not get fired. 
I'm basically using this as a success message after a submit on a form

A:

You would have to change this to something like 
vm.showSuccess = true;

$timeout(function () {
  close();
  vm.showSuccess = false;
}, 2000);

What's happening in your code is that the controller gets initialised and at that time vm.showSuccess is set to true, and on line 3 it gets set to false immediately, which is giving you the idea of it not getting executed. 
Note how in my code example your last line is actually inside the $timeout so that is executes 2 seconds later.