相关疑难解决方法(0)

AngularJS错误:仅支持协议方案的跨源请求:http,数据,chrome扩展,https

我有三个非常简单的角度js应用程序的文件

的index.html

<!DOCTYPE html>
<html ng-app="gemStore">
  <head>
    <script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js'></script>
    <script type="text/javascript" src="app.js"></script>
  </head>

  <body ng-controller="StoreController as store">
      <div class="list-group-item" ng-repeat="product in store.products">
        <h3>{{product.name}} <em class="pull-right">{{product.price | currency}}</em></h3>
      </div>

  <product-color></product-color>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

产品color.html

<div class="list-group-item">
    <h3>Hello <em class="pull-right">Brother</em></h3>
</div>
Run Code Online (Sandbox Code Playgroud)

app.js

(function() {
  var app = angular.module('gemStore', []);

  app.controller('StoreController', function($http){
              this.products = gem;
          }
  );

  app.directive('productColor', function() {
      return {
          restrict: 'E', //Element Directive
          templateUrl: 'product-color.html'
      };
   }
  );

  var gem = [
              {
                  name: "Shirt",
                  price: 23.11,
                  color: "Blue"
              },
              { …
Run Code Online (Sandbox Code Playgroud)

html javascript xmlhttprequest angularjs

126
推荐指数
8
解决办法
24万
查看次数

标签 统计

angularjs ×1

html ×1

javascript ×1

xmlhttprequest ×1