console.log not printing anything in Chrome Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!How do I print debug messages in the Google Chrome JavaScript Console?How to print a number with commas as thousands separators in JavaScriptDisable same origin policy in ChromeWhat is console.log?How can I pretty-print JSON using JavaScript?Node.js: printing to console without a trailing newline?How can I get the full object in Node.js's console.log(), rather than '[Object]'?console.log timestamps in Chrome?make an angular app with js bookmarkletJavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”

Illegal assignment from sObject to Id

Is grep documentation about ignoring case wrong, since it doesn't ignore case in filenames?

Chinese Seal on silk painting - what does it mean?

Why does it sometimes sound good to play a grace note as a lead in to a note in a melody?

Most bit efficient text communication method?

Should I use a zero-interest credit card for a large one-time purchase?

What is the appropriate index architecture when forced to implement IsDeleted (soft deletes)?

Using et al. for a last / senior author rather than for a first author

Why should I vote and accept answers?

How can I reduce the gap between left and right of cdot with a macro?

Why wasn't DOSKEY integrated with COMMAND.COM?

What's the meaning of "fortified infraction restraint"?

How often does castling occur in grandmaster games?

How does the math work when buying airline miles?

Hangman Game with C++

How do I use the new nonlinear finite element in Mathematica 12 for this equation?

Trademark violation for app?

Time to Settle Down!

Are all finite dimensional hilbert spaces isomorphic to spaces with Euclidean norms?

How do living politicians protect their readily obtainable signatures from misuse?

Why is Nikon 1.4g better when Nikon 1.8g is sharper?

Why doesn't SQL Optimizer use my constraint?

Disembodied hand growing fangs

Localisation of Category



console.log not printing anything in Chrome



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!How do I print debug messages in the Google Chrome JavaScript Console?How to print a number with commas as thousands separators in JavaScriptDisable same origin policy in ChromeWhat is console.log?How can I pretty-print JSON using JavaScript?Node.js: printing to console without a trailing newline?How can I get the full object in Node.js's console.log(), rather than '[Object]'?console.log timestamps in Chrome?make an angular app with js bookmarkletJavaScript console.log causes error: “Synchronous XMLHttpRequest on the main thread is deprecated…”



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















Can anyone please explain why console.log suddenly stopped to work? I'm trying to debug an exercise for an Angularjs class and at a certain point, console.log was not printing anything anymore.
I'using chrome and my cache is clear.



EDIT:
In this snippet and in Firefox console.log() works but in Chrome does not. How come?






(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>












share|improve this question



















  • 1





    because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

    – ZombieChowder
    Mar 22 at 10:09

















0















Can anyone please explain why console.log suddenly stopped to work? I'm trying to debug an exercise for an Angularjs class and at a certain point, console.log was not printing anything anymore.
I'using chrome and my cache is clear.



EDIT:
In this snippet and in Firefox console.log() works but in Chrome does not. How come?






(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>












share|improve this question



















  • 1





    because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

    – ZombieChowder
    Mar 22 at 10:09













0












0








0








Can anyone please explain why console.log suddenly stopped to work? I'm trying to debug an exercise for an Angularjs class and at a certain point, console.log was not printing anything anymore.
I'using chrome and my cache is clear.



EDIT:
In this snippet and in Firefox console.log() works but in Chrome does not. How come?






(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>












share|improve this question
















Can anyone please explain why console.log suddenly stopped to work? I'm trying to debug an exercise for an Angularjs class and at a certain point, console.log was not printing anything anymore.
I'using chrome and my cache is clear.



EDIT:
In this snippet and in Firefox console.log() works but in Chrome does not. How come?






(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>








(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>





(function () 
'use strict';

angular.module('Ass3', [])
.controller('NarrowItDownController', Narrowdown)
.service('MenuCategoriesService', MenuCategoriesService);


Narrowdown.$inject = ['MenuCategoriesService'];
function Narrowdown(MenuCategoriesService)
var nrdown = this;

var promise = MenuCategoriesService.getMatchedMenuItems();


MenuCategoriesService.$inject = ["$http"]
function MenuCategoriesService($http)
var service = this;
console.log("start");
service.getMatchedMenuItems = function(searchTerm)
return $http(
method : 'GET',
url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
).then(function(result)
var foundname = [];
angular.forEach(result.data.menu_items, function(value, key)
var name = value.name;
//console.log(typeof name);
if (name.toLowerCase().indexOf("chicken") !== -1)
foundname.push(name);
;
);
console.log("end");
return foundname;

);



)();

<!doctype html>
<html lang="en" ng-app='Ass3'>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
<script type="text/javascript" src="app.js"></script>
<title>Narrow Down Your Menu Choice</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles/bootstrap.min.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<div class="container" ng-controller="NarrowItDownController as nrdown">
<h1>Narrow Down</h1>

<div class="form-group">
<input type="text" placeholder="search term" class="form-control">
</div>
<div class="form-group narrow-button">
<button class="btn btn-primary">Narrow It Down For Me!</button>
</div>

<!-- found-items should be implemented as a component -->
<found-items found-items="...." on-remove="...."></found-items>
<ul>
<li ng-repeat="category in nrdown.categories">
categroy.name
</li>
</ul>
</div>

</body>
</html>






javascript angularjs console.log






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 15:26







RoRy

















asked Mar 22 at 10:07









RoRyRoRy

6413




6413







  • 1





    because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

    – ZombieChowder
    Mar 22 at 10:09












  • 1





    because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

    – ZombieChowder
    Mar 22 at 10:09







1




1





because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

– ZombieChowder
Mar 22 at 10:09





because you are executing it after return. The function terminates after you execute return, you should look into how return works in programming.

– ZombieChowder
Mar 22 at 10:09












2 Answers
2






active

oldest

votes


















0














You have log placed after return statement



return foundname;
console.log("end");


Just swap this lines like so



console.log("end");
return foundname;





share|improve this answer






























    0














    return foundname; should be below console.log()






    (function () 
    'use strict';

    angular.module('Ass3', [])
    .controller('NarrowItDownController', Narrowdown)
    .service('MenuCategoriesService', MenuCategoriesService);


    Narrowdown.$inject = ['MenuCategoriesService'];
    function Narrowdown(MenuCategoriesService)
    var nrdown = this;
    debugger
    var promise = MenuCategoriesService.getMatchedMenuItems();


    MenuCategoriesService.$inject = ["$http"]
    function MenuCategoriesService($http)
    var service = this;
    console.log("start");
    service.getMatchedMenuItems = function(searchTerm)
    return $http(
    method : 'GET',
    url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
    ).then(function(result)
    var foundname = [];
    angular.forEach(result.data.menu_items, function(value, key)
    var name = value.name;
    //console.log(typeof name);
    if (name.toLowerCase().indexOf("chicken") !== -1)
    foundname.push(name);
    ;
    );
    console.log("end");
    return foundname;
    );



    )();

    <!doctype html>
    <html lang="en" ng-app='Ass3'>
    <head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
    <script type="text/javascript" src="app.js"></script>
    <title>Narrow Down Your Menu Choice</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="styles/bootstrap.min.css">
    <link rel="stylesheet" href="styles/styles.css">
    </head>
    <body>
    <div class="container" ng-controller="NarrowItDownController as nrdown">
    <h1>Narrow Down</h1>

    <div class="form-group">
    <input type="text" placeholder="search term" class="form-control">
    </div>
    <div class="form-group narrow-button">
    <button class="btn btn-primary">Narrow It Down For Me!</button>
    </div>

    <!-- found-items should be implemented as a component -->
    <found-items found-items="...." on-remove="...."></found-items>
    <ul>
    <li ng-repeat="category in nrdown.categories">
    categroy.name
    </li>
    </ul>
    </div>

    </body>
    </html>








    share|improve this answer























    • Crazy, here is working but when I run it locally does not!

      – RoRy
      Mar 22 at 10:17











    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55297228%2fconsole-log-not-printing-anything-in-chrome%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You have log placed after return statement



    return foundname;
    console.log("end");


    Just swap this lines like so



    console.log("end");
    return foundname;





    share|improve this answer



























      0














      You have log placed after return statement



      return foundname;
      console.log("end");


      Just swap this lines like so



      console.log("end");
      return foundname;





      share|improve this answer

























        0












        0








        0







        You have log placed after return statement



        return foundname;
        console.log("end");


        Just swap this lines like so



        console.log("end");
        return foundname;





        share|improve this answer













        You have log placed after return statement



        return foundname;
        console.log("end");


        Just swap this lines like so



        console.log("end");
        return foundname;






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 22 at 10:09









        lankovovalankovova

        926213




        926213























            0














            return foundname; should be below console.log()






            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>








            share|improve this answer























            • Crazy, here is working but when I run it locally does not!

              – RoRy
              Mar 22 at 10:17















            0














            return foundname; should be below console.log()






            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>








            share|improve this answer























            • Crazy, here is working but when I run it locally does not!

              – RoRy
              Mar 22 at 10:17













            0












            0








            0







            return foundname; should be below console.log()






            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>








            share|improve this answer













            return foundname; should be below console.log()






            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>








            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>





            (function () 
            'use strict';

            angular.module('Ass3', [])
            .controller('NarrowItDownController', Narrowdown)
            .service('MenuCategoriesService', MenuCategoriesService);


            Narrowdown.$inject = ['MenuCategoriesService'];
            function Narrowdown(MenuCategoriesService)
            var nrdown = this;
            debugger
            var promise = MenuCategoriesService.getMatchedMenuItems();


            MenuCategoriesService.$inject = ["$http"]
            function MenuCategoriesService($http)
            var service = this;
            console.log("start");
            service.getMatchedMenuItems = function(searchTerm)
            return $http(
            method : 'GET',
            url: ("https://davids-restaurant.herokuapp.com/menu_items.json")
            ).then(function(result)
            var foundname = [];
            angular.forEach(result.data.menu_items, function(value, key)
            var name = value.name;
            //console.log(typeof name);
            if (name.toLowerCase().indexOf("chicken") !== -1)
            foundname.push(name);
            ;
            );
            console.log("end");
            return foundname;
            );



            )();

            <!doctype html>
            <html lang="en" ng-app='Ass3'>
            <head>
            <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" ></script>
            <script type="text/javascript" src="app.js"></script>
            <title>Narrow Down Your Menu Choice</title>
            <meta name="viewport" content="width=device-width, initial-scale=1">
            <link rel="stylesheet" href="styles/bootstrap.min.css">
            <link rel="stylesheet" href="styles/styles.css">
            </head>
            <body>
            <div class="container" ng-controller="NarrowItDownController as nrdown">
            <h1>Narrow Down</h1>

            <div class="form-group">
            <input type="text" placeholder="search term" class="form-control">
            </div>
            <div class="form-group narrow-button">
            <button class="btn btn-primary">Narrow It Down For Me!</button>
            </div>

            <!-- found-items should be implemented as a component -->
            <found-items found-items="...." on-remove="...."></found-items>
            <ul>
            <li ng-repeat="category in nrdown.categories">
            categroy.name
            </li>
            </ul>
            </div>

            </body>
            </html>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 22 at 10:12









            Ankit AgarwalAnkit Agarwal

            24.7k52245




            24.7k52245












            • Crazy, here is working but when I run it locally does not!

              – RoRy
              Mar 22 at 10:17

















            • Crazy, here is working but when I run it locally does not!

              – RoRy
              Mar 22 at 10:17
















            Crazy, here is working but when I run it locally does not!

            – RoRy
            Mar 22 at 10:17





            Crazy, here is working but when I run it locally does not!

            – RoRy
            Mar 22 at 10:17

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55297228%2fconsole-log-not-printing-anything-in-chrome%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해