ngMessagesInclude doen't work in ngMessages directive - angularjs

Includes:
angular/angular.min.js
angular-route/angular-route.min.js
angular-messages/angular-messages.min.js
This is my module.
var axipay = angular.module('axipay', [
'ngRoute',
'ngMessages',
'ngMessagesInclude',
'axipay.registration',
])
I used it like this.
<div ng-messages="form_register.phone.$error">
<div ng-messages-include="error-messages.html"></div>
</div>
This gets an error when loaded.
Failed to instantiate module ngMessagesInclude due to: Error:
[$injector:nomod] Module 'ngMessagesInclude' is not available! You
either misspelled the module name or forgot to load it. If registering
a module ensure that you specify the dependencies as the second
argument.
This working correctly without 'ngMessagesInclude'.
Ref:
https://docs.angularjs.org/api/ngMessages
https://docs.angularjs.org/api/ngMessages/directive/ngMessagesInclude

There is no module named ngMessagesInclude. Once you define the ngMessages dependency, you can access the ng-messages-include directive. So, remove the ngMessagesInclude dependency.
var axipay = angular.module('axipay', [
'ngRoute',
'ngMessages',
'axipay.registration',
])

Related

Module is not available - Angular JS

I have installed angular-stripe and have included it in controller as follows
angular
.module('payments', [
"angular-stripe"
])
.config(function (stripeProvider) {
stripeProvider.setPublishableKey('my_key')
})
But the following error is thrown.
Module 'angular-stripe' is not available! You either misspelled the
module name or forgot to load it. If registering a module ensure that
you specify the dependencies as the second argument.
(function (app) {
'use strict';
app.registerModule('payments');
}(ApplicationConfiguration));
You have to include this script in your application :
<script type="text/javascript" src="https://js.stripe.com/v2/"></script>
And angular-stripe.js :
<script src="npm-folder/angular-stripe.js"></script>
I hope this would help you!

nodejs Angular error in module app not available

Module 'ConatactsApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. var ContactsApp= angular.module('ContactsApp', [])
.run(function ($rootScope){
$rootScope.message = "Hello angular";
});
Check whether the html ng-app name is ConatactsApp or something else... if not ... change to ConatactsApp

Reuse Module to add controller?

I try to add a controller to an existing module. But I always get the following error message:
Uncaught Error: [$injector:nomod] Module 'pmm' is not available! You
either misspelled the module name or forgot to load it.
app.js
(function() {
'use strict';
angular.module('pmm', [
'ui.router',
'ui.bootstrap', ...
])
})();
login.js
(function() {
'use strict';
angular
.module('pmm')
.controller('LoginCtrl',LoginCtrl);
function LoginCtrl() {
}
})();
Can you show HTML file? You probably didn't include app.js in it...

how to inject d3 dependency?

I am new to angularjs ,i inject d3 in main.js as follow:
function (angular) {
'use strict';
angular.module('main', ['ngFileUpload', 'ngCookies', 'ui.router', 'd3'])
.constant('_', window._);
})(window.angular);
but i get an error:
Uncaught Error: [$injector:modulerr]
Failed to instantiate module main due to:
Error: [$injector:modulerr] Failed to instantiate module d3 due to:
Error: [$injector:nomod] Module 'd3' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
If you are using normal d3 library you dont inject angular dependencies.
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
You can use d3.js angular directives or d3 "wrappers" angular directives, i recommend you:
nvd3
c3-angular-directive

Error in loading a bootstrap ui angular model

I am new to angular and bootstrap, I have my login.html with LoginController.
I try to create a modal popup window, So in order to do it i need to add $modal to the controller, the current controller looks like:
angular.module('loginController', ['loginService'])
.controller('LoginCtrl', ['$scope', 'LoginService', function($scope, LoginService) {
But when i do:
angular.module('loginController', ['loginService','ui.bootstrap'])
.controller('LoginCtrl', ['$scope', '$modal','LoginService', function($scope, $modal,LoginService) {
I Received an error, and i am getting the following error:
Error: [$injector:modulerr] Failed to instantiate module loginController due to:
Error: [$injector:modulerr] Failed to instantiate module ui.bootstrap due to:
Error: [$injector:nomod] Module 'ui.bootstrap' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
I guess i need to add bootstrap-ui somewhere, maybe to:
angular.module('myApp', [
'ngRoute',
'bootstrap-ui', -> **when i add it, i still get the exception**.
What am i doing wrong ?
You need to reference one of ui-bootstrap-*.js files in your html.

Resources