Angular.js configuration not working

Asked

Viewed 285 times

1

I’ve scoured the internet for a solution, but in no way the angular works in my project. In the project in which I want to use it existed many javascript imports not know if this may be the problem, but below I illustrate how I am configuring it.

<html ng-app="jooceBox">
    <head ng-app="jooceBox">
        <meta charset="utf-8">
        <title>JooceBox v1.0</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <!-- Le styles -->
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.7/angular-resource.min.js"></script>
        <script src="${pageContext.request.contextPath}/resources/js/wizard/lib/modernizr-2.6.2.min.js"></script>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.js"></script>
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script>

<!-- Arquivo que contem as diretrizes do Angular -->
<script src="${pageContext.request.contextPath}/resources/js/app-crm/service.js" type="text/javascript"></script>

    <!-- Pulando o codigo -->

            <div ng-controller="StoreController">
                <p>{{greeting.text}}, world </p>
            </div>

    <!-- Pulando o codigo -->

    </head>

service js.

(function(){
    var app = angular.module('jooceBox', ['ngRoute','ngResource']);

    app.controller('StoreController', function($scope,$resource) {
        $scope.greeting = { text: 'Hello' };
    });

    var gem = {
        name : 'Azurite',
        price : 110.50,
        canPurchase : false,
        soldOut : false
    };
});

1 answer

2

Your code does not mention the basic Angular library. Try adding the following line (before angular-resource):

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.