Search Posts

Category: angular-ui-router

ionic 1 cache controller clear or reload

Hi I have a application in Ionic, it is 4 screen, and want refresh the controller when go from one view to another. but above all my problem lies in this controller: as you can see, what you see on the top right is the time, when it arrives a zero, finish the game and go to next page, but if i press in the previous view before the time runs out, the time (variable) […]

Redirect state to otherwise after refresh page

I use oclazyload to inject modules in my app, and ui-router to create states, everything work fine i can move between state home or users but when we change state to users.list and press F5 (refresh) state return to the otherwise state (/application/partials/index.html), what should i do to stay in users.list state after refreshing the page? index.html <div ng-app=”app”> <a ui-sref=”/”>home</a> <a ui-sref=”users.list”>users</a> <div ui-view></div> <script src=”Scripts/angular.js”></script> <script src=”Scripts/angular-ui-router.min.js”></script> <script src=”Scripts/ocLazyLoad.js”></script> <script src=”app.js”></script> </div> Main […]

Angular JS and Springboot integration using rest api

I am trying to connect two different small applications. Client application is in Angular 5 and Server side is in Spring boot. Angular 5 application works fine on localhost:4200/register port and Spring boot (Server Side) works fine on port localhost:8080/api/demo. For integration I have used added a proxy.conf.json file in Angular Application. I have updated package.json script also. Followed the instruction on the website: Both the projects are in same workspace. Angular project files […]

Webpack angular ui router – losing css style

When I’m using npm run dev to run webpack app with ui.router implementation, my styles are broken (without input a ui-view and main styles). Then I delete all stateProvider code, run it again. Then everything is ok. Next, I just put code again and works still after refreshing. Any ideas? My app.js code: const css = require(‘./src/style/app.scss’); var angular = require(‘angular’); import ‘@uirouter/angularjs’; var ngModule = angular.module(‘app’, [‘ui.router’]); require(‘./src/js/contact’)(ngModule); require(‘./src/js/adminNetworks’)(ngModule); require(‘./src/js/automatic’)(ngModule); require(‘./src/js/login’)(ngModule); require(‘./src/js/program’)(ngModule); require(‘./src/js/register’)(ngModule); require(‘./src/js/main’)(ngModule); […]

Webpack angularjs ui-router

I am having problems with ui router implementation in my webpack app. I downloaded it: npm install –save @uirouter/angularjs Then just in my app.js file: const css = require(‘./src/style/app.scss’); var angular = require(‘angular’); var uiRouter = require(‘@uirouter/angularjs’); var ngModule = angular.module(‘app’, [‘uiRouter’]); require stuff. ngModule.config(function($stateProvider, $locationProvider){ $stateProvider // routing .state(‘home’, { url: ‘/’, templateUrl: ‘main.html’, controller: ‘MainCtrl’ }) .state(‘program’, { url: ‘/program’, templateUrl: ‘program.html’, controller: ‘ProgramCtrl’ }) .state(‘administration’, { url: ‘/administration’, templateUrl: ‘adminNetworks.html’, controller: ‘NetworkCtrl’ […]

Inject ui-router resolve result on controller

I’m trying to inject this fieldsList variable resolved by a service in a controller but I’ve got an error: projectApp = angular.module(‘projectApp’, [‘ui.router’]); projectApp.config(function($stateProvider, $urlRouterProvider, $locationProvider, $httpProvider) { $urlRouterProvider.otherwise(‘/’); $stateProvider.state(‘initial’, { url: ‘/’, template: ‘Hi !’ }) .state(‘fields’, { url: ‘/customers/fields’, resolve: { fieldsList: function (fieldService) { return fieldService.getFields(); } }, views: { ”: { controller: ‘fieldController’, templateUrl: ‘/static/app/customers/pages/fields.html’ }, ‘[email protected]’: { controller: ‘fieldListController’, templateUrl: ‘/static/app/customers/pages/fields.list.html’ } } }) //$locationProvider.html5Mode(true); }); // The controller projectApp.controller(‘fieldListController’, […]

Two query parameters in a url

Previously, I have defined a state of ui-router which has connected as parameter: .state(‘addinEdit’, { url: ‘/addin/edit/{id}?connected’, resolve: { test: [$stateParams, function($stateParams) { console.log($statePrams.connected) }] } } As a result, I could call in a html: <a href=”addin/edit/?connected=true” target=”_self”>New</a> Now, I want to add another query parameter ifi in the url, I tried .state(‘addinEdit’, { url: ‘/addin/edit/{id}?connected?ifi’, resolve: { test: [$stateParams, function($stateParams) { console.log($statePrams.connected) console.log($statePrams.ifi) }] } } But <a href=”addin/edit/?connected=true?ifi=true” target=”_self”>New</a> does not seem […]

ui-route: when the page reloaded after log in, it throws me 404 error . Can any one help me out?without reloading it works fine

I’m new to ui-routing. Actually, i’m trying to load the dashboard after login successfully.I’m able to achieve that, but when I reload the page after log in ,it’s throwing me 404 error not found. when I don’t reload the page it’s working fine. Take a look at my plunker and please help me out Source: AngularJS

Can anyone help me how to redirect into home page after log in using ui-route?

Can anyone help me how to redirect into home page after log in using ng-rout & ui-route? and also want to load home.html inside index.html .below is my plunker code this is my home html <div ui-view></div> <!– templates –> <script type=”text/ng-template” id=”tab-viewport.html”> <div> <ul class=”tabs”> <li ui-sref=”.account” ui-sref-active=”selected”>Account</li> <li ui-sref=”.survey” ui-sref-active=”selected”>Survey</li> </ul> <div ng-show=”$state.includes(‘tabs.account’)” ui-view=”account”></div> <div ng-show=”$state.includes(‘tabs.survey’)” ui-view=”survey” ></div> </div> </script> <script type=”text/ng-template” id=”account.html”> <h1>Account</h1> <a ui-sref=”.stuff”>My Stuff</a> <a ui-sref=”.things”>My Things</a> <div ui-view></div> […]

Next Page »