Questions tagged [angular-amd]

angularAMD is an utility that facilitate the use of RequireJS in AngularJS applications supporting on-demand loading of 3rd party modules such as angular-ui.

59 questions
9
votes
1 answer

How do I use AngularAMD without routes

I have an AngularAMD app, and I have a directive that depends (in a RequireJS sense) on that app (it is the Angular module in which that directive "lives"). If I use routing, and use the directive inside a routed view, then there is a route that…
Michael Lorton
  • 43,060
  • 26
  • 103
  • 144
8
votes
2 answers

How to mock service in angularAMD with karma/jasmine?

I have a project using AngularAMD/RequireJS/Karma/Jasmine, that I have the basic configuration all working, most unit tests run and pass successfully. I cannot get a mocked service injected correctly using either angular.mock.module or…
7
votes
1 answer

AngularAMD + ui-router + dynamic controller name?

I'm trying to write a generalized route in my application and resolve the view and controller names on the fly based on the route params. I have the following code that works: $stateProvider.state('default', angularAMD.route({ url:…
Sayak Banerjee
  • 1,954
  • 3
  • 25
  • 58
6
votes
1 answer

AngularJS $timeout isn't waiting for UI-Router to finish rendering before computing values

I'm using angularJS and requirejs via angularAMD to wire together a complex application. One of my states has two simple views like so: $stateProvider .state("common", { url: "/", views: { "view1": { …
nikk wong
  • 8,059
  • 6
  • 51
  • 68
4
votes
1 answer

angularjs with requirejs not working

Trying to implement angularjs with requirejs. I am following this. Not getting success! Partials are not going to load. No errors in console. Angularjs is not working: i.e when I simply writes in HTML as : {{1+2}}, it is not printing 3, but as it…
VBMali
  • 1,360
  • 3
  • 19
  • 46
3
votes
2 answers

Angular service injection using RequireJS

I'm using AngularAMD + RequirsJS for a single page app and I'm having some issues when injecting a service in the app.js file. Here the code: login_service.js define(['app'], function(app) { 'use strict'; app.service('loginService',…
JDL
  • 231
  • 4
  • 16
2
votes
1 answer

Bower install requirejs resulting in only a .bower.json file

I am fetching requirejs with the command bower install requirejs ---save and this is resulting in a requirejs folder being added to my components folder, but within it the require.js file (and all other files) is not there. The only file added is a…
Josh
  • 1,648
  • 8
  • 27
  • 58
2
votes
0 answers

How to use ocLazyLoad in Angular 1.5.7 with ui.router?

I am developing one SPA using Angular 1.5.7 . In that application routing is done with "ui.router". i have a separate folders for each component like Dashboard,Users,Reports and each folder contains its own component and directive, view and service…
2
votes
0 answers

Not able to inject dependency in app.run() in angularAMD

I am first time using AngularAMD and RequireJS. I am trying to inject one service (appService) in app.run() but I am getting error: Unknown provider: appServiceProvider <- appService main.js: var bowerPath = 'bower_components/'; require.config({ …
Saurabh Palatkar
  • 3,242
  • 9
  • 48
  • 107
2
votes
1 answer

Angularjs and Requirejs: Error: [$injector:modulerr]

I started using angularjs to create a single page application and wanted to add dynamic templates (views and controllers). I read on the web that I should use requirejs for doing this so I did. I followed this tutorial @…
yadbo
  • 407
  • 1
  • 5
  • 16
2
votes
0 answers

Angular loads the template but doesnt show it

I'm trying to build an angularJs app, i'm also using requireJs with angularAMD package. My project structure |root |-> bower_components |-> html |--> index.html |--> tmpl |---> test.html |-> js |--> app.js |--> main.js |--> controllers …
Sefa
  • 8,865
  • 10
  • 51
  • 82
2
votes
0 answers

Issue with service injection in ui-router resolve when using AngularAMD

Is it possible to inject services into a route/state resolve when using AngularAMD/RequireJS? The pattern of using route/state resolves to prepare data for a controller before the controller loads is a nice practice. I find it's especially useful…
2
votes
3 answers

AngularAMD + ui-router multiple views does not load controllers

I'm trying to use angular-ui-router with angularAMD and there is one thing I cannot get working. I have one abstract state (named "first") and another nested state (named "second") that inherits from "first" and that contains a views key with 2…
Joel Poulin
  • 23
  • 1
  • 7
2
votes
3 answers

ng-table not being loaded appropriately when using angularAMD

I'm using angularAMD with requirejs and when I try to supply the ng-table module to the controller, I'm getting Uncaught TypeError: Cannot read property 'module' of undefined from the ng-table module. The source of the error: var app =…
user773366
2
votes
1 answer

Require.js + AngularAMD - Error: [ng:areq] Argument 'loginController' is not a function, got undefined

I have looked through all the similar questions I can find but none was helpful in resolving this error: Error: [ng:areq] Argument 'loginController' is not a function, got undefined. Below are my files: LoginController.js "use strict"; …
cig
  • 23
  • 8
1
2 3 4