Taha Baig
Taha Baig

Reputation: 1

still getting angular not defined

this is html file

<!DOCTYPE html>

<html ng-app="myApp">

    <head>

        <title>BlogIt!</title>
        <script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
        <script type="text/javascript" src="app.js"></script>
    </head>

    <body ng-controller="myCtrl">

        {{message}}

    </body>

</html>

this is js file

var app = angular.module('myApp', []);

app.controller('myCtrl', function($scope){

    $scope.message = "Welcome to BlogIt!";

})

Upvotes: 0

Views: 62

Answers (1)

Swapnil
Swapnil

Reputation: 358

Edit with this :

<head>
    <title>BlogIt!</title>
    <script type="text/javascript" src="bower_components/angular/angular.min.js"></script>
    <script type="text/javascript" src="app.js"></script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
    {{message}}
</body>

Upvotes: 2

Related Questions