Giter VIP home page Giter VIP logo

angularjs-routing's People

Contributors

bennadel avatar kzu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angularjs-routing's Issues

Big thanks

Ben, thanks for this. I spent hours with vanilla routing, and more hours with ui-router... nothing did the trick. Parent views getting re-rendered when only the child views should have been affected was the crux of the problem, which your implementation solved.

I ended up doing a bit of abstraction but am not yet sure if it was wise -- only time will tell!

A small note: as of Angular 1.2.0rc1, in the $routeChangeSuccess callback, getting the action can be done like so:

var action = $route.current.$$route && $route.current.$$route.action;

AngularUI Nested Routes

So you've probably been following this thread: angular/angular.js#1198 and known there's a lot of suggestions and discussions around nested routing (including your own solution).

I was looking over your code because I was asked to give a recommendation and unfortunately there are some parts to every solution I've found which have remained unclear.

That being said, I think it would be awesome if we can get everyone's efforts merged together and have been thinking of starting a Nested Routes team on the AngularUI org.

Would you be interested? It would likely be built off a foundation of your code mixed with a few other solutions to come up with the best of all worlds.

ng-switch-when Not work! in v1.2.0rc1 on angularJS

Hi Ben, In my opinion your approach is very flexible than using ng-view and the ui-Roure project. I upgrade angular to v1.2.0rc1 and unfortunately the ng-switch not work!. I remove ng-switch-when="standard" and the template loaded!! can you help me?

Angular Js Routing generate "XMLHttpRequest cannot load" Error in Google chrome

Both basic routing example and the one which include html on page without reloading generates the error given below in Google Chrome, code and error are given below...Guide me with solution for same...

index.html

  html ng-app="demoApp"
head
    meta charset="UTF-8"
    titleRoutingtitle
    script src="../angular.min.js"script
    script src="../angular-route.js"script
    script src="app.js"script
head
body
    div ng-viewdiv
body

html

app.js

        var demoApp = angular.module('demoApp', ['ngRoute']);
        demoApp.controller('NameCtrl', function($scope, $http){
            $http.get("../countries.json").success(function(data){
                alert("Hello");
                $scope.countries = data;
            }).error(function(data, status){
                alert("No Hello");
                alert(status);
                $scope.data = data || "Request failed";
                $scope.status = status;
            });
        });
        demoApp.controller('CntryDtlCtrl', function($scope, $routeParams){
            alert($routeParams);
            console.log($routeParams);

        });
        demoApp.config(function($routeProvider){
            $routeProvider
                  .when('/',{
                        template: '<ul><li ng-repeat="entity in countries">{{entity.country}}</li></ul>',
                        controller: 'NameCtrl'
                  }).
                  when('/:country',{
                    // Add # with a name i.e country name in the url to get this content eg. file:///Users/karthicklove/Documents/Aptana%20Studio%203%20Workspace/Object_Javascript/Angular_Js/50_examples/Routing/index.html#/china
                    template: '<h1>TODO create country detail view<h1>',
                    controller: 'CntryDtlCtrl'
                  }).
                  otherwise({
                    redirectTo: '/'
                  });
        });

Error: "XMLHttpRequest cannot load file://localhost/Users/karthicklove/Documents/Aptana%20Studio%203%20Workspace/Object_Javascript/Angular_Js/50_examples/countries.json. Cross origin requests are only supported for protocol schemes: http, data, chrome-extension, https, chrome-extension-resource. "

ngRoute not working. is there something i am doing wrong.

<title>a</title> <script src="Scripts/angular.min.js" type="text/javascript"></script> <script src="Scripts/angular-route.min.js" type="text/javascript"></script> <script type="text/javascript"> var App = angular.module('App', ['ngRoute']);
        App.config(function ($routeProvider) {                
            $routeProvider
                .when('/', { templateUrl: 'Partials/View1.htm', controller: 'SimpleController' })
                .when('/partial2', { templateUrl: 'Partials/View2.htm', controller: 'SimpleController' })
                .otherwise({ redirectTo: '/AJTest' });
        });

        App.controller('SimpleController', function ($scope) {
            $scope.customers =
                                [
                                    { name: 'a', city: 'a' },
                                    { name: 'b', city: 'b' },
                                    { name: 'c', city: 'c' },
                                    { name: 'd', city: 'd' }
                                ];
            $scope.addCustomer = function () {
                $scope.customers.push({ name: $scope.newCustomer.name, city: $scope.newCustomer.city });
            }
        });

    </script> 
    <div data-ng-controller="SimpleController">
        Name :<br /> 
        <input type="text" data-ng-model="name" />  {{ name }}    
        <ul>
            <li data-ng-repeat="cust in customers | filter:name | orderBy:city">{{ cust.name  + ' ' + cust.city}} </li>
        </ul>
    </div>                                
</body>
---------------------**********************************************---------------------------------------- Partials\View1.htm goes like this.

View 1

Name :

  • {{ cust.name }}

CustomerName : CustomerCity : Add Customer

Please help. thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.