The angular.module is a global place for creating, registering and retrieving Angular modules. All modules (angular core or 3rd party) that should be available to an application must be registered using this mechanism.
0
votes
1answer
20 views
Get angular module name in javascript
I want to get Angular Module name in JavaScript.
Means i want to retrieve module name of angular js application in my javascript file so that i can apply other functionality on that module.
I want ...
60
votes
8answers
56k views
is there a way in Angularjs to define constants with other constants?
I'm trying to define constants with other constants, but it seems that it can't be done, because the initial constant isn't ready when the required constant depending require it. I want to be sure if ...
774
votes
13answers
173k views
AngularJS : Difference between angular-route and angular-ui-router
I am new to AngularJS. I find Angular quite interesting and planning to use angular in my big apps. So I am in the process to find out the right modules to use.
What is the difference between ngRoute ...
17
votes
5answers
70k views
AngularJS: Uncaught Error: [$injector:modulerr] Failed to instantiate module?
I am new to AngularJS and working my way through some documents and tutorials to learn. My question is in reference to Egghead's video series, this video in particular, demonstrating how to put ...
15
votes
1answer
7k views
How to share data between two modules in AngularJS?
I am using AngularJS along with c# mvc. I have a home page where user enters some data and that should be passed to the second module where I use this data for processing and decisions. I have to use ...
0
votes
3answers
1k views
AngularJS Error: [$injector:modulerr]
I have following angular code which is in my /public/javascripts dir in my node project:
var app = angular.module('userContent', ['angularUtils.directives.dirPagination']);
app.controller('MainCtrl',...
1
vote
5answers
1k views
How can I have multiple controller files?
SOLVED
So after viewing your responses and making minor changes to my code, I found a simple typo which prevented me to reach the result I was after. So thank you all to helping with where I was ...
1
vote
2answers
232 views
Nested modules in AngularJS
I Have 2 differents AngularJs modules : a widgetContainer and a widget.
A widget can be displayed as an independant application or be included into a widgetContainer. A widgetContainer contains 0-N ...
0
votes
1answer
104 views
App Module Not Found AngularJS
For some reason its giving me errors when i try to run this code. (i will post code then error at bottom):
index.html:
<!DOCTYPE html>
<html>
<head>
<meta id="meta" name="...
8
votes
1answer
3k views
Angularjs - how to correct inject service from another module that is not depending?
I didn't understand how work modular depending.
I have 4 modules, they are dependent on each other, as shown in the picture.
"App" module includes "module1" and "module2".
"module2" includes "core" ...
1
vote
0answers
47 views
Use angular-ui-notification in anuglar service instead of controller?
I am able to use above mentioned module in controller with below syntax but while try to use same in service its not working.
app.controller('regulationCtrl', function ($scope, $rootScope, $http, $...
33
votes
6answers
16k views
How to check for the existence of a module without an error being raised?
In Angular 1.2, ngRoute is a separate module so you can use other community routers like ui.router instead.
I'm writing an open-source module that aims to work for multiple different router ...
0
votes
1answer
28 views
Can anyone explain to me difference between angular.module('myApp.data') and angular.module('myApp')?
i want to understand the difference between angular.module('myApp.data') and angular.module('myApp').
1
vote
3answers
50 views
How use shared services with controllers that use no shared services?
Assume there is a module with only one factory (the shared service).
angular.module('sharedService', [])
.factory('sharedSrv', sharedService)
function sharedService() {
var number;
return {
...
0
votes
1answer
27 views
angularJS: Provider of app A not available in config of app B; app B is the main app attached to DOM
I have a Provider defined in an angular module say A, and I am trying to use it in the config of another angular module say B, as shown in the following code snippet:
var A = (function(ng){
'use ...
1
vote
1answer
260 views
How to use constants defined in one file in another in angularjs
Well I have seen couple of questions in StackOverFlow related to this but couldn't find proper answer.
Say in my app.js file I have defined a constants object which basically has controllers names. ...
0
votes
3answers
90 views
Get service from separate angular module
You have 2 angular modules, and one of those modules has a service that you want to use in the other module:
var moduleA = angular.module ('moduleA', [])
.service('FirstService', ...
6
votes
2answers
1k views
Angular Module Private Members
In AngularJS, is it possible to create private controllers or services which can be used within the module they are defined in, but not by another module they are injected into.
For example, can ...
0
votes
1answer
69 views
Memory leaks witht the “angular.module” getter?
John Papa recommends chaining instead of creating variables while dealing with modules (see the modules section) :
avoid using a variable and instead use chaining with the getter syntax
He ...
19
votes
4answers
13k views
Is it possible to override constants for module config functions in tests?
I've spent quite a while banging my head against trying to override injected constants provided to modules' config functions. My code looks something like
common.constant('I18n', <provided by ...
1
vote
1answer
99 views
AnguarJS module to wrap javascript libraries
I'd like to use a library in my angular project that provides sliders written in javascript/jQuery. Therefore I would write a directive inside my project, with a certain interface to use the library-...
2
votes
1answer
979 views
karma.conf.js uncaught referencerror: google no defined
when i try running the karma test runner, i'm getting a error as the following from one of my files, saying that my library google is undefined???
Chrome 36.0.1985 (Mac OS X 10.9.4) ERROR
...
-2
votes
1answer
81 views
How to integrate two angular js modules from two different servers?
We want to develop a angular js module for our application and want to integrate in other angular js app.
These apps renders from two different servers.
I have read about angular js multple modules ...
0
votes
3answers
95 views
Angularjs Multiple modules
I am writing a website and I need two AngularJs modules: ngRoute and ui.bootstrap.
Now, my script for ngRoute is
var ngRouteApp=angular.module('ngRouteApp',["ngRoute"]);
ngRouteApp.config(['$...
1
vote
1answer
94 views
Argument 'indexController' is not a function, got undefined
This has been asked before but it didn't answer my question. I am pretty new to angular and I am just putting things together at the moment. I am trying to get my factory to work inside my controller. ...
12
votes
2answers
8k views
Using a factory inside another factory AngularJS
I have a module...
angular.module('myModule', []);
And then a factory
angular.module('myModule')
.factory('factory1', [
function() {
//some var's and functions
}
]);
And then another factory
...
0
votes
1answer
60 views
Angular module dependency
is possible I start my angular module without some dependency?
it's my angular.module
angular.module("app", [
'ngSanitize', 'ngAnimate', 'ui.router', 'ngMaterial',
'ngRoute', 'ngCookies', '...
0
votes
2answers
98 views
AngularJS: Module not found error when creating module from asynchronous function's callback
When i try to create angularjs module in usual way, it works perfect, but when i try to execute same code inside a callback function of aync function call, it throws error that module not found:
The ...
0
votes
1answer
1k views
Angularjs module error
I am new to angularJs, trying to make app which use camera and save images in firebase. I am following one tutorial and getting this error. I tried to fix it but it didn't work out. Pls help guys.
I ...
0
votes
0answers
30 views
AngularJS modularity and configuration
I have a feature that has controllers, services, and templates in it which I want to use in two separate projects. I've put template and controller names into a constant so I can change if I need. It ...
0
votes
1answer
53 views
google angular module don't work
I add this to my proyect: https://angular-ui.github.io/angular-google-maps/#!/
i follow the suggestion and add this files to my proyect mvc in the BundleConfig (Downloaded by Nuget):
bundles....
0
votes
2answers
321 views
angularJS global filter module
I am having trouble getting my custom filter to work.
I have a module of global filters:
angular.module('globalFilters', []).filter('dateRange', function () {
return function(item) {
...
1
vote
2answers
3k views
AngularJS Modules and External Controllers
I have a page containing multiple containers. Each container will have its own controller but point to one factory, which handles all the logic interacting with a web service API. I would like to have ...
0
votes
1answer
261 views
Calling service.js file from controller
I have a service file which needs to be called from the controller. Can someone please tell the code which should go in the controller to get this service file. Thank you.
This is my service file ...
0
votes
2answers
73 views
Angular js directive in module not working correctly
I have one module call "menuLeft", when module he initiate ,not loading correctly my directive, but if run my function en el method "run" correctly.
I dont know why is this.
This is my code
(...
0
votes
1answer
190 views
Angular JS: How to use ng-repeat with custom directive and dynamic model?
I've a template as follows:
<div class="row search-panel">
<div ng-show="loadingAirports">
<i class="glyphicon glyphicon-refresh"></i> Searching...
</div>...
2
votes
1answer
50 views
How do you design a module that a user has to pass config data to when they depend on it?
I have an angular module that is basically a client side web service layer (work in progress). I have a module declaration, and a factory called "baseRequest". baseRequest is depended on by other ...
5
votes
2answers
54 views
controller function in angularjs?
I am new to angular js
Controller is not working correctly in my code
i am trying to run following code
<!DOCTYPE html>
<html data-ng-app >
<head>
<title>Using AngularJS ...
0
votes
2answers
42 views
Refer to service in run immediately after definition?
I would like to attach a string from a service to every request. Attempt:
'use strict';
angular.module('main')
.service('Foo', function () {
self.bar = 'haz';
})
.run(function ($...
1
vote
2answers
49 views
Controller not working in Angular JS
I am new to Angular JS. To see the working of controller, I implemented this simple code where two numbers are taken as an input from the users and their sum is calculated in the controller and the ...
2
votes
1answer
166 views
Vanilla AngularJs not loading up.
I am new to Angularjs. Trying to make a basic application. Getting stuck.
I loaded the angularjs
<script type="text/javascript"
src="https://code.angularjs.org/1.4.8/angular.min.js"></...
2
votes
3answers
1k views
Meaning of the empty array in angularJS module declaration
In my previous question, I understand that the code var app = angular.module('myApp', []); connects the module app to the view myApp.
I would like to know why we are having the empty array [] in the ...
0
votes
1answer
24 views
How do angularJS modules work in multipage applications
If you have a webpage that uses one module across several pages, does that module need to be loaded every time a new page is opened or is it just loaded in the initial page (assuming there is no ng-...
0
votes
0answers
47 views
Running an initialize Parse function inside of an AngularJS module
I've read that a good way to initialize Parse is when the module is created. I made the following code, however Parse does not seem to be initializing when I run my program. Am I missing something ...
1
vote
1answer
650 views
Why am I getting the Angular $injector:modulerr error here? Using 1.5 beta
The markup
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular I&...
0
votes
2answers
244 views
ReferenceError: invalid assignment left-hand side (app.js:41:27) & nothing is displayed angular
After starting my server I navigate to 'localhost:8000'. The only thing I see is console error "ReferenceError: invalid assignment left-hand side" for row $scope.userLogin() = function(userSrv)...
3
votes
1answer
1k views
Angularjs Uncaught Error: [$injector:unpr]
I am developing shoping website with java and I am using angurajs.
I have problem with thise files:
DashboardControll.js
'use strict';
var app = angular.module("DashboardApp", []);
app....
0
votes
2answers
101 views
Function problems in AngularJs
I'm a beginner in Angular and I have a problem with the functions. I have a simple code. In that there are two alerts to probe they are not getting called.
HTML
<div data-ng-controller="MainCtrl"&...
0
votes
1answer
820 views
Angular: Module was created but never loaded
I am have trying to fix this but not able to find a solution since a long time. I an angular newbie and trying to make my website home an angular app. The angular app has a controller and 2-3 ...
1
vote
1answer
134 views
Rootscope for Modules in Angular Js
Does having multiple modules in an angular app means there are multiple $rootScope?
If yes, how can we communicate between multiple $rootScopes?