0
votes
index.html
html ng-app="myapp">
<head>
    <title>kanna</title>
    <meta charset="UTF-8">

<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js"></script>
<script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
</head>
<body ng-controller="Ctrl">
    <label>NAME</label>
    <input type="text"  ng-model="name">
    <label>AGE</label>
    <input type="text" ng-model="age">
    <button ng-click="create()">swathi</button>
</body>
</html>

app.js:

var app=angular.module('myapp',['ui.bootstrap']);
app.controller("Ctrl",['$scope','$modal',function($scope,$modal){
    $scope.create=function(){
        var modalInstance=$modal.open({
            templateUrl:'page.html',
        })
    }
}
    ])

three error is coming is: file://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js Failed to load resource: net::ERR_FILE_NOT_FOUND file://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css Failed to load resource: net::ERR_FILE_NOT_FOUND file://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.13.4.js Failed to load resource: net::ERR_FILE_NOT_FOUND find the solution and reply . the full details and how to setup js files and css .give the detail information

1
It means your angularjs reference is not loadedSajeetharan

1 Answers

0
votes

You are loading the index.html from your file system (by double clicking the file in file-explorer?).

This gives the default scheme for relative references inside the HTML page as file:.

Hence, when you try to include the file "//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js", then it tries to look for file://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js.

There are several ways of fixing this problem:

  1. Change the default scheme to https:// to load the file from the CDN instead. So change the "//ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js" to "https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.js" and similarly for other files.
  2. Use a web-server to host the file locally. If you have python, for example, go to the folder which has index.html, and run python -m SimpleHTTPServer (Python 2) or python -m http.server. Then point your browser to http://localhost:8000. This will give the default scheme of http: to the relatively referred files and will load them from the CDN.

The latter is the preferred way.