256 questions
0
votes
0
answers
31
views
What is the meaning of components inside array when declaring angular js module?
I am new in angular js. I have the following code
angular.module('app', ['components'])
.controller('MyApp', function($scope) {
$scope.message = "Hello World!";
});
what is the meaning ...
1
vote
4
answers
2k
views
How to include .css file of my component in angular js
I have included my component's .css file in this manner
`
angular.
module('home').
component('home', {
templateUrl: 'home/home.template.html',
styleUrls: 'home/home.component.css'
...
-1
votes
1
answer
453
views
Error - AngularJS Uncaught TypeError:angular.service is not a function at taskService.js:2
I'm having these errors in angularJS, with well-imported libraries, I don't know what might be happening. Exactly these two:
Uncaught TypeError: angular.service is not a function
at ...
1
vote
1
answer
80
views
Controller is not registered error after adding ngRoute `.config`
Controller is not recognizing - AngularJS error
I've a controller defined in controllerPloyee.js called controllerPloyee which was working before i added the ngRoute and made to route. The error that ...
0
votes
0
answers
56
views
Unable to access an angularjs module inside another module
I have an angularJS app with three modules: myApp(parent/core module), services(contains all the factories and services), and controllers(contains all the controllers).
This is my app.js file
angular....
0
votes
1
answer
293
views
CI/CD pipeline deployment of AngularJS1.5.11 to azure websites giving error "Failed to instantiate module app.core due to Unknown provider: ENV_VARS"
after deploying the "AngularJs_1.5.11" app to "azure-websites" using "azure-devops" continuous-integration and deployment gives error:
[$injector:modulerr] Failed to instantiate module app due to:
...
1
vote
0
answers
73
views
Issue with lazy loaded angularjs child module with routes (states)
I'm working with an angularjs + ui-router application which is a shell application of my other angularjs application (basically header + footer + sidenav).
Each application I'm developing is complied ...
0
votes
1
answer
55
views
Failed to instantiate module in AngularJS due to missing (loaded) provider
Working on an old project using AngularJS, and seem to be getting the good old "Failed to instantiate module" error due to "Unknown provider", but the funny thing is that the module that provides this ...
1
vote
2
answers
91
views
Uncaught Error: [$injector:nomod] while Angularjs separating code into Controller and Service files
I'm trying to split the code into Controller and Service files as below.
Module.js
/// <reference path="../angular.js" />
/// <reference path="../angular-resource.js" />
var ...
1
vote
1
answer
379
views
Is it possible to implement trait in AngularJS?
I want to implement traits like PHP in AngularJs. What is the best solution to do it?
0
votes
1
answer
111
views
How to use module function inside another factory in angularjs
I have configurations.js file which having
var configurationModule = angular.module('configuration', ['restangular', 'notification']);
configurationModule.factory('clientConfigSvc', function (...
2
votes
1
answer
66
views
How do I hook an AngularJS directive into two different projects?
I am searching for a tutorial on specifically this, but don't seem to find it, so maybe its something I missed:
If I declare a module, saved as myproject.js
var myProject = angular.module('myProject'...
0
votes
1
answer
73
views
One controller not working out of the two I used in my angular module
I used two controllers in my angular module, but one is not working, I don't know what is wrong, I've browsed online for solution but I can't get what's wrong.
var app = angular.module('myWebsite'...
1
vote
3
answers
1k
views
Difference between module dependency and service dependency in AngularJS
I don't understand what's the difference between module dependency and service dependency. For example,
angular.module('components.users', [])
.controller('UsersController', function(Users) {
...
0
votes
1
answer
423
views
Getting Error: $injector:modulerr Module Error when adding angular-bootstrap-lightbox dependency
I am trying to add a dependency for the project, is a simple gallery lightbox for angularjs.
https://github.com/compact/angular-bootstrap-lightbox
I followed the steps, tried using npm, I ended up ...
0
votes
0
answers
224
views
angularjs tree view is not working getting module error
I am trying to use angularjs for creating tree view and I am getting module error. I am trying to follow this link https://github.com/eu81273/angular.treeview
I followed the steps
added the js and ...
0
votes
2
answers
439
views
ngMaterial throwing Error: [$injector:modulerr]
I am using ngMateril for custom dialog. But I am getting error as Error: [$injector:modulerr]. I am not able to figure out the error. Any help would be appreciated.
External scripts in my HTML code
...
1
vote
2
answers
337
views
AngularJS(1.6.8) : Failed to instantiate module
I try to create a simple application on AngularJS that consists of several modules.
app.module.js
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import angularLoadingBar ...
-2
votes
2
answers
388
views
Angularjs Routing Parameter passing to controller
Below code is not working for parameter passing
<li class="active" ng-disabled="disabledAction"><a href="#!/Reservation/821" ><i class="fa fa-fw fa-pencil-square-o icon-push"><...
0
votes
1
answer
243
views
AngularJS - module uses config from a different file
I am new to AngularJS and I don't know if this is possible.
This is my current code:
var app = angular.module('qlikCockpitApp',['pascalprecht.translate','720kb.tooltips']);
app.config(['$...
0
votes
1
answer
150
views
`$injector:modulerr` when Importing submodule in angularjs
I am having some trouble importing my sub-module when using the AngularJS framework.
I have created the module and its dependencies, checked my import order and imported the js files in the index....
0
votes
1
answer
452
views
Circular dependencies on angular modules using typescript
I'm facing this issue where i have 2 angular 1.5 modules that depend on each other, which is fine by angularjs, but when i import them using typescript & webpack, i get circular typescript-module ...
3
votes
1
answer
2k
views
How to bootstrap two Modules using bootstrapModule() in Angular2?
Normally this is how a Module is integrated or bootstrapped with the main.ts.
import {platformBrowserDynamic} from'@angular/platform-browser-dynamic'
import {AppModule} from './app.module'
...
1
vote
3
answers
273
views
Angular JS - module.controller parameters [duplicate]
I'm new to Angular JS and in a tutorial they place that the way to create a controller is:
angular.module('app', [])
.controller('TodoController', ['$scope', function ($scope) {
$scope.todos = [...
2
votes
1
answer
2k
views
Uncaught Error: [$injector:unpr] Unknown provider:
I'm currently getting this error trying to load my Angular App:
Uncaught Error: [$injector:unpr] Unknown provider: $$HashMapProvider
<- $$HashMap <- $$animateQueue <- $animate <- $...
0
votes
1
answer
1k
views
How can I access constants in another file from my app.js file?
I need a separate .js file which I can store in some constants.
I need to use the constants in this file in the app.js file.
The structure I am using for this and the mistake that I have encountered ...
0
votes
1
answer
836
views
Can parent module directives be used in child modules like controllers?
Just as controllers are module "level" independent and can be used anywhere in the entire application stack I am wondering if there is a way for child module to use the parent modules directives ...
0
votes
1
answer
889
views
How to setup Angular Material for AngularJS 1.3.0
I am trying to implement Angular Material into an app that is using Angular 1.3.0 (the lowest version that Angular Material supports).
I have an index.php that contains the following:
<script src=...
4
votes
1
answer
3k
views
Can't include ngMessages Module in Angularjs application after bower install
I'm having a lot of trouble trying to install and import the angular-messages module in an angularjs project. Here is the error message
Uncaught Error: [$injector:modulerr] Failed to instantiate ...
0
votes
1
answer
128
views
Any issues when injecting the same dependency across different modules within the same app?
I'm currently attempting to modularise an angular app by splitting it into features with each feature being a module that has it's own dependencies.
Example structure:
angular.module('myApp', ['...
1
vote
3
answers
1k
views
Angular js: How to Use constants values in other services without changing it
I am new to Angular js and want to set the global variable that I can use it on different different services as webservice url.
I have implemented app.js (module) like this:
var app;
(function () {
...
2
votes
5
answers
5k
views
(AngularJS) Can't inject factory into controller
I'm trying to inject my factory into a controller. If I list the factory as one of the controller's parameters, I get this error:
Error: [$injector:unpr] Unknown provider: wordRushFacProvider <- ...
0
votes
2
answers
358
views
Can't inject constant to other modules angularjs ionic
I want to use constant variables which can be called from anywhere in the project.
I made 'constants.js'.
angular.module('myApp.constants', [])
.constant('const', (function(){
return {
...
2
votes
1
answer
5k
views
Is it ok to write multiple Angular component in a single file?
I am about to write a common Angular module which can be used as a plug and play module in my application.
What I want
I want to put the module definition and all its factory, directive, constants ...
2
votes
2
answers
227
views
Angularjs Modules - Packaging Directives and Their Controllers
I have the following javascript code and i ran into a issue:
My .js file
angular.module('MyApp',['ngMaterial','ngMessages'])
.controller('MainCtrl',['$mdDialog',function($mdDialog'){
this.openDialog ...
1
vote
1
answer
102
views
AngularJs used with Play cannot find or instantiate module
I am using the Play Framework (2.5.9). On my scala html template, I pull in Angular via WebJars. I next specify the module and controller I want to use for my page. However, when I try to load the ...
1
vote
1
answer
1k
views
Angular failed to instantiate modules in production build
I'm trying to add features requiring new third party modules to an Angular app, using gulp and bower. Everything is fine in dev mode but any new modules I add produce the notorious "Failed to ...
0
votes
0
answers
128
views
How can I bootstrap an AngularJS module using variables?
I have a preloader module which retrieves some environment data. It then bootstraps the AngularJS app. I'd like to make this module reusable (as it should be) by passing variables for module and ...
0
votes
3
answers
546
views
angularjs 1 manual bootstrap doesnot work
I am new to angularjs.
I tried to create 2 different modules in an single js file and them manually bootstrap one of them to a element. This was suggested in one of the stackoverflow questions. But ...
0
votes
1
answer
824
views
angular, how to combine modules
I have a page html1.html with the module mod1
[html1.html]
<html lang="en" ng-app="mod1">
...
<script src="scripts/services/Data.js"></script>
And Data.js is a factory for mod1
[...
0
votes
1
answer
1k
views
Angular Js routing not working properly when file separated
//this is the app.js go down below to see controller.js
angular.module('myFirstApp',['ngRoute'])
.config(function($routeProvider){
$routeProvider.when('/contact',{
templateURL : 'contact....
0
votes
1
answer
2k
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 ...
0
votes
1
answer
354
views
What is the difference between using bower and npm for adding angular module?
I am trying to add a new angular module.
https://github.com/angular/bower-angular-animate
I noticed that there are 2 ways to add an angular module. One is using bower. The other is using npm.
$ npm ...
3
votes
2
answers
1k
views
AngularJS set constant according to the result of an http request
I want to set module.constant according to a tag which is the result of an HTTP request.
Below is the demo code in my project;
code in app.js
(function(){
var myApp = angular.module('myApp',['...
1
vote
1
answer
139
views
How to design two modules include the same dependency issue in angularjs
I have an app module which include another modules for example module a and b. But both module a and b depends on module c. See the followings
var app = angular.module('app', ['a', 'b']);
app....
0
votes
0
answers
137
views
Upgrading angular 1 to 2
I'm trying to follow the upgrade steps for Angular 1 to 2. I've put in the following code to allow for a hybrid application:
import * as angular from 'angular';
import {upgradeAdapter} from './...
1
vote
1
answer
151
views
factory is undefined when using ng-file-upload
I have a form in which I save some details and upload a file. I have a factory from which I get some data. When I use ng-file-upload the factory is undefined. Here is the code:
angular.module('...
0
votes
0
answers
132
views
AngularJs inject providers error
I'm trying to inject two providers and I have an error:
Error: [$injector:modulerr] Failed to instantiate module App due to:
[$injector:unpr] Unknown provider: $paginationTemplateProvider
Here's ...
0
votes
1
answer
349
views
"Restangular" Error: $injector:modulerr Module Error
I try to make authorization in my app with angular.
I created app.service and injected "Restangular". And i have this error
Error: $injector:modulerr Module Error Failed to instantiate module ...
0
votes
1
answer
202
views
in angular how to add nested object to ng-repeat
I'm a complete angular noob so please forgive the rudimentary question.
I have a post/comment structure for my model that looks like this:
[
{
"title": "awesome post",
"desc": "...