I made 2 jsfiddles to demonstrate my issue.
In the first one, the promise resolves (mocking successful restapi response) and everything works as expected: https://jsf