Angular JS Expressions does not work?? The value 10 does not appear and Work? appears with keys. Help!

Asked

Viewed 34 times

1

<!DOCTYPE html>
<html ng-app>
<head>
    <title>Teste</title>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.8/angular.min.js"></script>
</head>
<body>
    <p>{{5+5}}</p>
    <p>{{ Work? }}</p>
</body>
</html>

I’ve tried everything else! I saw if the src link was already up to date and working, I tried to change with module and Interpolate.Provider, sometimes it works and it just seems to stop working. Please, if anyone has any ideas, let me know. Thanks, hug!

  • What is Work?? this will give error if not set

  • I messed up ali kkkk was supposed to be a string later

  • @Lucasniehuesdefarias do not modify the answers to add content. If adding content do so in the question itself.

1 answer

0

Remove the ? of <p>{{ Work? }}</p>, he is causing the error:

Error: "[$parse:ueoe] http://errors.angularjs.org/1.7.8/$parse/ueoe?p0=Work%3F"
    Angular 42
angular.js:15567:15

For more information about the error see the link above.

Removing the question mark:

inserir a descrição da imagem aqui

Tip: Always when working with anything in javascript, be it pure, with library or framework open the browser Developer tool and leave in the console tab, there you will see all errors and or warnings, i found your problem in 5 seconds by having the custom of leaving the Developer tool open when working with javascript.

Example of firefox: inserir a descrição da imagem aqui

  • So I changed, but now it gives another error on the console. I’m beginner, so it might be something simple. I’ll edit up with the new problem. Thank you!

  • Have you declared "Work" somewhere, in the controller, in the context? Otherwise it will give error

Browser other questions tagged

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