AuthService with AngularJS not work - angularjs

Hi friends i am new with angular js.
i try to create login and register with angular js.
i used this tutorials for authentication.Click here
i got this error i don't know why i think i forgot to include any authentication js file.
please how to resolve this error.

i think you are using $routeProvider for your angular app. but in your example angular app is using $stateProvider.so you have to install angular-ui-router.js and give reference to it to the index.html .
and also you have to put dependency 'ui.router' in to app.js

Stop the Javascript based authentication and opt for a token based approach using server-side language like PHP coupled with AJAX.

Related

How to load modules in Angular Electron?

I have a functioning angular electron application which was made using this boilerplate code:
https://github.com/maximegris/angular-electron
I am trying to add the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) to my application and I'm stuck at "loading the module in your application by adding it as a dependent module":
angular.module('app', ['ngSanitize']);
How can I do this in an angular electron application with the current file setup? Thank you!
Like you can read on electron's website it uses Angular v2+ (currently 6.1.2). And you are trying write in AngularJS.
For the beginning here is something about modules: https://angular.io/guide/ngmodules but I would suggest you get familiar with whole tutorial and new version of Angular

"Backand is not defined" after angular js quickstart

I get this error when I'm trying to use simple CRUD action
ReferenceError: Backand is not defined
I did everything step by step like they requested but something is wrong and I can figure out what... thanks!
Ensure you do this stuffs:
Add backand sdk as script in your index.html files.
src="//cdn.backand.net/backand/dist/1.8.2/backand.min.js"
Add 'backand' as angular module dependency
angular.module('YOUR-APP-NAME', ['backand'])
In your controller add Backand with 'B' uppercase.
myApp.controller('SimpleController', function(Backand){
})

Angularjs with liferay

I am trying to use angular Js with liferay 6.2. But I am getting error in injecting controller. Same code works well in spring web app. Angular js not compatible with liferay?
Error : [injector: unpr] http://errors.angularjs.org/1.4.9
It looks like you forgot to load the module.

Use AngularJS (Angular1) module from Angular2 project

Just started a demo Angular2 project (no previous experience with Angular1/AngularJS. Have followed and extended from the online quickstart and tutorials, and all was fine. However I'm at the point where I would like to use some components from a library which is designed for AngularJS, and having no end of problems!
Most of the information available about AngularJS/Angular2 compatibility assumes that you have an AngularJS project that you're adding Angular2 components to - not the other way around - so what I'm hoping to do may not even be possible. What I've tried so far involves a simple stripped-back project based on the Angular2 quickstart, with a single Angular2 component that loads into the index.html. I'd then like to integrate components from the existing library (AngularJS-based) into this.
I've tried using UpgradeAdapter.upgradeNg1Component to create components from the library and add them directly into my Angular2 component
I've tried installing angularjs through npm, importing it in a script tag into my index.html and then using a combination of UpgradeAdapter.downgradeNg2Component and UpgradeAdapter.bootstrap to load my Angular2 as a downgraded module
Neither of these seem to work - the component fails to show, and the browser console tells me I've got an Uncaught SyntaxError: Unexpected token <
Evaluating http://localhost:3000/angular2/upgrade
Error loading http://localhost:3000/app/main.js
My best guess at the moment is that this is actually an unsupported scenario, and I need to have a 'proper' AngularJS app in order to use the UpgradeAdapter functionality from Angular2. Can anyone confirm this? Or is there something stupid I'm missing here?
Here is a working plunkr describing how to mix Angular1 and Angular2 elements:
http://plnkr.co/edit/yMjghOFhFWuY8G1fVIEg?p=preview
An important point is to bootstrap your main component on the UpgradeAdapter. This way all elements are available in providers (services / factories) and in directives (components / directives):
upgrade.bootstrap(document.body, ['heroApp']);
These two answers could help you:
angular 1.x and angular2 together
How to inject upgraded Angular 1 service/factory to Angular 2 component in ES5?
So the major problem in this case turned out to be the fact that it appears that the upgrade components aren't included as part of the basic angular 2 bundle. After adding:
<script src="node_modules/angular2/bundles/upgrade.min.js"></script>
to my index.html file the error I was seeing disappeared.
Thanks to the answer here for pointing me in the right direction!

How to use AngularJs with Laravel 5.2 as laravel blading template and angular directive have same tags {{}}

I have read many blogs relating to this and have tried for almost a week but unable to use the both together.
Also let me tell you I have also tried using angular Js with #{{}} and also by changing the tags of angular through interpolate on module initialization.So please suggest any other method
In your blade code simply add # to Angular braces.
Example:
#{{name}}
This tells blade not to parse or treat the braces as blade code but to ignore the braces and simply output
{{name}}
Read Blade section in Laravel documentation for more info.
You can change angular syntax using $interpolationProvider:
var sampleApp = angular.module('sampleApp', [], function($interpolateProvider) {
$interpolateProvider.startSymbol('<%');
$interpolateProvider.endSymbol('%>');
});
Or change blade template configuration using Blade facade
Blade::setContentTags('<%', '%>');
Blade::setEscapedContentTags('<%%', '%%>');
One of these stragegy will be mandatory if you are using blade and angular
You'd better re-think of your app structure and use Laravel for WebServices only.

Resources