AngularJS - TypeError: cribsFactory2.getCribs2(…).then(…).error is not a function [duplicate]










0
















This question already has an answer here:



  • Error with $http.get in angularJS — Success not a Function

    9 answers



  • Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

    2 answers



I'm having the following error:
angular.min.js:125 TypeError: cribsFactory2.getCribs2(...).then(...).error is not a function
at Object. (cribsController3.js:12)



I found some topics about this error but I wasn't able to solve the issue (I did some changes in my code, but no luck). Can someone help me?



Here are the files which I'm using:



cribsFactory2.js



angular
.module('ngCribs')
.factory('cribsFactory2', function($http)

function getCribs2()
return $http.get('scripts/data.json');


return
getCribs2: getCribs2

);


cribsController3.js



angular
.module('ngCribs',)
.controller('cribsController3', function($scope, cribsFactory2)

$scope.cribs2;

cribsFactory2.getCribs2()
.then(function(response)
$scope.cribs2 = response; ;
)
.error(function(error)
console.log(error);
);
);


app.html



<body ng-app="ngCribs" ng-controller="cribsController3">
<div class="well" ng-repeat="crib in cribs2">
<h3>crib.address</h3>
<p><strong>Type: </strong> crib.type</p>
<p><strong>Description</strong> crib.description</p>
<p><strong>Price</strong> crib.price</p>
</div>









share|improve this question













marked as duplicate by georgeawg angularjs
Users with the  angularjs badge can single-handedly close angularjs questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 21:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

    – georgeawg
    Nov 10 '18 at 21:20
















0
















This question already has an answer here:



  • Error with $http.get in angularJS — Success not a Function

    9 answers



  • Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

    2 answers



I'm having the following error:
angular.min.js:125 TypeError: cribsFactory2.getCribs2(...).then(...).error is not a function
at Object. (cribsController3.js:12)



I found some topics about this error but I wasn't able to solve the issue (I did some changes in my code, but no luck). Can someone help me?



Here are the files which I'm using:



cribsFactory2.js



angular
.module('ngCribs')
.factory('cribsFactory2', function($http)

function getCribs2()
return $http.get('scripts/data.json');


return
getCribs2: getCribs2

);


cribsController3.js



angular
.module('ngCribs',)
.controller('cribsController3', function($scope, cribsFactory2)

$scope.cribs2;

cribsFactory2.getCribs2()
.then(function(response)
$scope.cribs2 = response; ;
)
.error(function(error)
console.log(error);
);
);


app.html



<body ng-app="ngCribs" ng-controller="cribsController3">
<div class="well" ng-repeat="crib in cribs2">
<h3>crib.address</h3>
<p><strong>Type: </strong> crib.type</p>
<p><strong>Description</strong> crib.description</p>
<p><strong>Price</strong> crib.price</p>
</div>









share|improve this question













marked as duplicate by georgeawg angularjs
Users with the  angularjs badge can single-handedly close angularjs questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 21:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

    – georgeawg
    Nov 10 '18 at 21:20














0












0








0









This question already has an answer here:



  • Error with $http.get in angularJS — Success not a Function

    9 answers



  • Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

    2 answers



I'm having the following error:
angular.min.js:125 TypeError: cribsFactory2.getCribs2(...).then(...).error is not a function
at Object. (cribsController3.js:12)



I found some topics about this error but I wasn't able to solve the issue (I did some changes in my code, but no luck). Can someone help me?



Here are the files which I'm using:



cribsFactory2.js



angular
.module('ngCribs')
.factory('cribsFactory2', function($http)

function getCribs2()
return $http.get('scripts/data.json');


return
getCribs2: getCribs2

);


cribsController3.js



angular
.module('ngCribs',)
.controller('cribsController3', function($scope, cribsFactory2)

$scope.cribs2;

cribsFactory2.getCribs2()
.then(function(response)
$scope.cribs2 = response; ;
)
.error(function(error)
console.log(error);
);
);


app.html



<body ng-app="ngCribs" ng-controller="cribsController3">
<div class="well" ng-repeat="crib in cribs2">
<h3>crib.address</h3>
<p><strong>Type: </strong> crib.type</p>
<p><strong>Description</strong> crib.description</p>
<p><strong>Price</strong> crib.price</p>
</div>









share|improve this question















This question already has an answer here:



  • Error with $http.get in angularJS — Success not a Function

    9 answers



  • Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

    2 answers



I'm having the following error:
angular.min.js:125 TypeError: cribsFactory2.getCribs2(...).then(...).error is not a function
at Object. (cribsController3.js:12)



I found some topics about this error but I wasn't able to solve the issue (I did some changes in my code, but no luck). Can someone help me?



Here are the files which I'm using:



cribsFactory2.js



angular
.module('ngCribs')
.factory('cribsFactory2', function($http)

function getCribs2()
return $http.get('scripts/data.json');


return
getCribs2: getCribs2

);


cribsController3.js



angular
.module('ngCribs',)
.controller('cribsController3', function($scope, cribsFactory2)

$scope.cribs2;

cribsFactory2.getCribs2()
.then(function(response)
$scope.cribs2 = response; ;
)
.error(function(error)
console.log(error);
);
);


app.html



<body ng-app="ngCribs" ng-controller="cribsController3">
<div class="well" ng-repeat="crib in cribs2">
<h3>crib.address</h3>
<p><strong>Type: </strong> crib.type</p>
<p><strong>Description</strong> crib.description</p>
<p><strong>Price</strong> crib.price</p>
</div>




This question already has an answer here:



  • Error with $http.get in angularJS — Success not a Function

    9 answers



  • Why are AngularJS $http success/error methods deprecated? Removed from v1.6?

    2 answers







angularjs






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 '18 at 21:14









rrudnickirrudnicki

32




32




marked as duplicate by georgeawg angularjs
Users with the  angularjs badge can single-handedly close angularjs questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 21:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by georgeawg angularjs
Users with the  angularjs badge can single-handedly close angularjs questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Nov 10 '18 at 21:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

    – georgeawg
    Nov 10 '18 at 21:20


















  • The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

    – georgeawg
    Nov 10 '18 at 21:20

















The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

– georgeawg
Nov 10 '18 at 21:20






The .success and .error methods are deprecated and have been removed from AngularJS V1.6.

– georgeawg
Nov 10 '18 at 21:20













0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Malaysia to Papua New Guinea by motorcycle?

PHP code is not being executed, instead code shows on the page