Sharing Top Content from the Angular-sphere.

Using ui-router, when changing states it seems to load angular twice. • /r/angularjs

  • Test App md-nav-item[md-nav-sref=’categories’ name=’services’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Services md-nav-item[md-nav-sref=’categories’ name=’howitworks’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] How It Works md-nav-item[md-nav-sref=’categories’ name=’aboutus’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Our Story
  • But when I change states to categories/accessories.
  • Using ui-router, when changing states it seems to load angular twice.
  • I can see the actual scripts inside .main-view for some reason when changing states.
  • subreddit: subreddit find submissions in “subreddit” author: username find submissions by “username” site: example.com find submissions from “example.com” url: text search for “text” in url selftext: text search for “text” in self post contents self:yes (or self:no) include (or exclude) self posts nsfw:yes (or nsfw:no) include (or exclude) results marked as NSFW

I can see the actual scripts inside .main-view for some reason when changing states. My routes: angular.module(‘myApp’).config [ …

@Beepop_Agency: Using ui-router, when changing states it seems to load angular twice.:

I can see the actual scripts inside .main-view for some reason when changing states.

My routes:

angular.module(‘myApp’).config [

‘$stateProvider’,

($stateProvider ) ->

# Routes. This should be separated from here when we have more routes $stateProvider

angular.module(‘myApp’, [‘ngMaterial’, ‘ui.router’, ‘templates’]).config [‘$mdThemingProvider’, ‘$locationProvider’, ($mdThemingProvider, $locationProvider) -> $mdThemingProvider.theme(‘default’) .primaryPalette(‘grey’)

doctype html

html[lang=I18n.locale]

head

base[href=root_url]

= stylesheet_link_tag ‘application’, media: ‘all’

= javascript_include_tag ‘application’

meta[name=’viewport’ content=’width=device-width, initial-scale=1′]

body[ng-app=’myApp’ ng-cloak]

header[ng-include src=”‘application/views/public/nav-bar.html'” ng-controller=”NavController”]

.main-wrapper[flex layout=’column’]

.main-content[role=’main’ flex layout=’column’ ui-view]

footer[ng-include src=”‘application/views/public/footer.html'”]

nav-bar.html

md-nav-bar.nav[aria-label=’main page nav’ layout=’row’ layout-align=’space-around center’]

a[ng-click=’openLeftMenu()’ href=” aria-label=’button side nave trigger’ hide-gt-sm show-sm show-xs flex-sm=’5′]

i.fa.fa-lg.fa-bars

md-menu[flex=’60’ hide-sm hide-xs show-gt-sm md-offset=’0 50′]

md-button[aria-label=”open categories menu” ng-click=”$mdOpenMenu($event)”] Categories

md-menu-content[width=”3″]

md-menu-item

md-nav-item[md-nav-sref=’categories’ name=’Resources’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Resources

md-nav-item[md-nav-sref=’categories’ name=’DetailsofaTee’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Details of a Tee

md-nav-item.home-page-link[md-nav-sref=’home’ name=’rich honey’ flex=’60’ flex-sm=’85’ ui-sref-active=’active’] Test App

md-nav-item[md-nav-sref=’categories’ name=’services’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Services

md-nav-item[md-nav-sref=’categories’ name=’howitworks’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] How It Works

md-nav-item[md-nav-sref=’categories’ name=’aboutus’ flex=’60’ ui-sref-active=’active’ hide-sm hide-xs show-gt-sm] Our Story

md-sidenav[md-component-id=’left’ class=’md-sidenav-left’]

md-list

md-list-item[ui-sref=’home’ name=’rich honey’ ui-sref-active=’active’ style=”font-size: 40px;”] Test App

md-list-item[ui-sref=’home’ name=’Categories’ ui-sref-active=’active’] Categories

md-list-item[ui-sref=’home’ name=’Resources’ ui-sref-active=’active’] Resources

md-list-item[ui-sref=’home’ name=’DetailsofaTee’ ui-sref-active=’active’] Details of a Tee

md-list-item[ui-sref=’home’ name=’services’ ui-sref-active=’active’] Services

md-list-item[ui-sref=’home’ name=’howitworks’ ui-sref-active=’active’] How It Works

md-list-item[ui-sref=’home’ name=’aboutus’ ui-sref-active=’active’] Our Story

angular.module(‘myApp’).controller ‘NavController’, [ ‘$scope’, ‘$mdSidenav’, ‘$state’, ($scope, $mdSidenav, $state) ->

As you can see, the ui-view isn’t wrapped in the NavController. But when I change states to categories/accessories. It loads angular inside the .main-wrapper

Using ui-router, when changing states it seems to load angular twice. • /r/angularjs

Comments are closed, but trackbacks and pingbacks are open.