Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/424.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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 ng包括在firefox中工作而不是在chrome中工作_Javascript_Html_Angularjs - Fatal编程技术网

Javascript ng包括在firefox中工作而不是在chrome中工作

Javascript ng包括在firefox中工作而不是在chrome中工作,javascript,html,angularjs,Javascript,Html,Angularjs,我的代码只在Firefox中运行,不在chrome中运行 HTML代码 <div ng-controller="myController1"> Select View: <select ng-model="employeeview"> <option value="1.html">1</option> <option value="2.html">2</op

我的代码只在Firefox中运行,不在chrome中运行

HTML代码

<div ng-controller="myController1">

    Select View:
        <select ng-model="employeeview">
            <option value="1.html">1</option>
            <option value="2.html">2</option>
        </select>

        <div ng-include="employeeview"></div>
    </div>
1.html内容

2.html

演示



“''-->你必须这样做

AngularJS表达式对URL求值。如果源是字符串常量,请确保用单引号将其括起来,
例如src=“'template.html'”


ng include=“employeeview”

chrome将不支持跨源文件。如果在项目中运行本地服务器,它将在所有浏览器中正常工作在服务器上运行。试试http服务器,它将由defaultThanxx@CodeMan…部署在本地主机:8080上。。。。它的工作
        var app = angular.module('myApp', []);
        app.controller('myController1', function($scope) {
            var employees = [
            {name: "Inderjeet", dateofbirth: new Date("November 23, 1980"), gender: "male", salery: "5000.788"},
            {name: "Ravi Pandey", dateofbirth: new Date("November 13, 1980"), gender: "male", salery: "5000.788"},
            {name: "Dilip", dateofbirth: new Date("November 30, 1991"), gender: "male", salery: "1000.000"},
            {name: "Deepika", dateofbirth: new Date("jan 25, 1980"), gender: "Female", salery: "50040.788"},
            {name: "Pradeep", dateofbirth: new Date("November 21, 1980"), gender: "male", salery: "5560.788"}
            ];
            $scope.employees = employees;
            $scope.employeeview = "1.html";


        });
<div data-ng-include="'views/employeeview.html'">
replace  $scope.employeeview = '1.html';