TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Swetha
NA
196
25.6k
Error: [$injector:undef] in angualrjs
Mar 25 2019 4:16 AM
Hi ,
I created a service and injected that into a controller.But getting error like "Error: [$injector:undef] http://errors.angularjs.org/1.6.9/$injector/undef?p0=addlabtestsvc"
what would be the error?
Please respond ASAP.
controller:
var
app=angular.module(
'AddlabTest'
,[]);
app.controller(
"AddlabTestcontroller"
,[
'$scope'
,
'addlabtestsvc'
,
function
($scope,addlabtesttsvc)
{
$scope.msg=
"Angularexample"
;
$scope.SaveToLabtest=
function
()
{
alert(
""
);
addlabtestsvc.addItem();
}
}]);
Service:
"use strict"
;
(
function
()
{
angular.module(
'AddlabTest'
)
.factory(
'addlabtestsvc'
,
function
()
{
var
addItem =
function
()
{
alert(
"message"
);
};
});
})();
Reply
Answers (
1
)
Angular js with mvc
How change detection work in angular ?