Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我的观点是不绑定角度模块_Javascript_Json_Angularjs - Fatal编程技术网

Javascript 我的观点是不绑定角度模块

Javascript 我的观点是不绑定角度模块,javascript,json,angularjs,Javascript,Json,Angularjs,嗨,这是我在angular的第一天,我尝试着玩一些代码,但是我对app.js文件感到迷茫,它抛出了一个错误作为未捕获的SyntaxError:Unexpected token 这是我的应用程序结构,我从angular seed中克隆并进行了一些清理 index.html finance.js 知道这个代码出了什么问题吗 angular.module'myApp',['finance'];,这个终止语句。删除它,它就会工作。不,它不会。我尝试过它,它会抛出下一个错误Uncaught Referen

嗨,这是我在angular的第一天,我尝试着玩一些代码,但是我对app.js文件感到迷茫,它抛出了一个错误作为未捕获的SyntaxError:Unexpected token

这是我的应用程序结构,我从angular seed中克隆并进行了一些清理

index.html

finance.js


知道这个代码出了什么问题吗

angular.module'myApp',['finance'];,这个终止语句。删除它,它就会工作。

不,它不会。我尝试过它,它会抛出下一个错误Uncaught ReferenceError:angular定义得不好,您确实需要包含一个指向其中包含angular的文件的。。。
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Currency Converter</title>  
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <script src="app.js"></script> 
    <script src="finance.js"></script>
</head>
<body>
    <div ng-app="myApp" ng-controller="MyAppCtrl as app">
        <b>Currency Converter</b>
        <div>
            <input type="number" ng-model="app.amount" required >
            <select ng-model="app.inCurr">
                <option ng-repeat="c in app.currencies">{{c}}</option>
            </select>
        </div>
        <div>
            <input type="number" ng-model="app.amount" required >
            <select ng-model="app.inCurr">
                <option ng-repeat="c in app.currencies">{{c}}</option>
            </select>
        </div>
    </div>  
</body>
</html>
(function(){
    'use strict';
    angular.module('myApp', ['finance']);
    .controller('MyAppCtrl', ['currencyConverter', function(currencyConverter) {
        this.amount=1;
        this.inCurr="EUR";
        this.currencies=currencyConverter.currencies;
    }]);
}());
(function(){
    'use strict';
    angular.module('finance', []);
    .factory('currencyConverter', ['$http', function($http) {
        //var yahoo_finance_rest_api=https://query.yahooapis.com/v1/public/yql?   q=select%20*%20from%20yahoo.finance.xchange%20where%20pair%20in%20(%22EURUSD%22%2C%22GBPUSD%22%2C%22EURGBP%22%2C%22CNYUSD%22%2C%22CNYGBP%22%2C%22CNYEUR%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=
        var currencies = ['USD', 'EUR', 'CNY', 'GBP'];
    }]);
}());