How to assign a value in $scope in a promise response? [duplicate]

I have the following code, where I am trying to show the value of Bitcoin in a text box after getting it from the coinmarketcap REST API, using the axios library. Although the value is written fine in console, the text box remains empty. What mistake am I doing here?

<!DOCTYPE html>
<script src=""</script>
<script src=""></script>

<div ng-app="myApp" ng-controller="myCtrl">

<input ng-value="myVar">


var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    function get_btc_value(){
        // return this promise
        return axios.get('')

    get_btc_value().then(data => $scope.myVar = data)


Source: AngularJS