Code Monkey home page Code Monkey logo

angularjs-up-and-running's People

Contributors

jesselpalmer avatar kyle7zhang avatar shyamseshadri avatar siecje 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  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

angularjs-up-and-running's Issues

Chapter 6: why module-override?

Hello! I am enjoying your book, thank you.

In Chapter 6, I am unclear how method-override is being used in server.js.

I thought perhaps a naive attempt to use $http.delete wouldn't work without it, but that doesn't appear to be the case: I made a test branch at https://github.com/amacleay/angularjs-up-and-running/tree/delete-example with such a naive implementation and it seems to work fine:

  • Clone to a new directory (cd $(mktemp -d);git clone https://github.com/amacleay/angularjs-up-and-running; cd angularjs-up-and-running)
  • Checkout the new branch, install, and start (git checkout delete-example; npm i; npm start)
  • Navigate to the example and verify that it works

I'm just curious what method-override does in this example. Hopefully it's not explained in the next chapter or I'll feel foolish!

Issue with checkbox-example.html on page 63 Chapter 4: Forms, Inputs and Services

Hi,
I appreciate the work done on this book. Anyone can learn angularjs with the help of this book.
I notice one small issue with checkbox example on page 63 Chapter 4: Forms, Inputs and Services.
ng-true-value & ng-false-value should be enclosed with single quotes ("'YES'" and "'NO'")

Wrong :
ng-true-value="YES"
ng-true-value="NO"

Right:
ng-true-value="'YES'"
ng-true-value="'NO'"

Chapter11: directive-broken-reference

I noticed that the source code of chapter11/directive-broken-reference/index.html here is a little more complex than the code on the book (pages 186-187). It has an extra List of Stocks Repeating Manually section:

    <h3>List of Stocks Repeating Manually</h3>
    <div stock-widget stock-data="mainCtrl.stocks[0]">
    </div>
    <div stock-widget stock-data="mainCtrl.stocks[1]">
    </div>

I am a little confused why when the button in this section is clicked, it will update both List of Stocks Using Repeaters and List of Stocks Repeating Manually. (The book explained why when we click the button in List of Stocks Using Repeaters, the text in List of Stocks Repeating Manually wouldn't be updated.)

Simplify stock.html for legibility

Simplify from:

<!-- File: chapter11/directive-broken-reference/stock.html -->
<div class="stock-dash">
  Name:
  <span class="stock-name"
        ng-bind="stockData.name">
  </span>
  Price:
  <span class="stock-price"
        ng-bind="stockData.price | currency">
  </span>
  Percentage Change:
  <span class="stock-change"
        ng-bind="getChange(stockData) + '%'">
  </span>

  <button ng-click="changeStock()">
    Change Stock in Directive
  </button>
</div>

to:

<!-- File: chapter11/directive-broken-reference/stock.html -->
<div>
  Name: {{stockData.name}}
  Price: {{stockData.price | currency}}
  Percentage Change: {{getChange(stockData) + '%'}}

  <button ng-click="changeStock()">
    Change Stock in Directive
  </button>
</div>

Javascript Runtime Error: angular is undefined

I am new to Angular. Trying to build a sample appilication with VS.NET 2015 using angularjs.
When i try to load my application,I am facing this issue. Appreciate your help.
HTML

<meta name="viewport" content="width=device-width" />
<title></title>
<link href="CSS/amelia.bootstrap.min.css" rel="stylesheet" />
<link href="CSS/Site.css" rel="stylesheet" />   
<script src="~/Scripts/angular.js"></script>      
<script src="~/Content/app/Controllers/RegistrationController.js"></script>
<script src="~/Content/app/Resources/RegistrationResource.js"></script>   

In Body:

  • -

    Controller.js

    var app = angular.module('regApp', ['regApp2']);
    app.controller('RegistrationCtrl', ['$scope', function ($scope, rescountries) {

        $scope.GetCountries = function () {
            var countries = rescountries.GetAllCountries();
            countries.$promise.then(function (data) {
                $scope.countries = data;
                $scope.selectedCountry = 1;
            }, function (error) { $scope.RegistrationResource = false });
        };
    

    }]);

    Service.js

    var app = angular.module('regApp2', []);
    app.factory('RegistrationResource', ['$http', function ($http) {
    var urlBase = 'http://localhost:62463/';

        var rescountries = {};
    
        rescountries.GetAllCountries = function () { return $http.get(urlBase + '/api/Registration/GetAllCountries') }
        return rescountries;
    }]);
    

    Api call

    using WebAPIAngular.DAL;
    using WebAPIAngular.Entities;
    using WebAPIAngular.Models;
    using WebAPIAngular.Controllers;
    namespace WebAPIAngular.WebAPI
    {
    [RoutePrefix("api/Registration")]
    public class RegistrationController : ApiController
    {
    // GET api/GetAllStates/{id}
    [Route("api/GetAllStates/{id}")]
    public IEnumerable GetAllStates(int id)
    {
    return StateRepository.GetAllStates(id);
    }

        // GET api/GetAllCountries
        [HttpGet]
        [Route("api/GetAllCountries")]
        public IEnumerable<Country> GetAllCountries()
        {
            return CountryRepository.GetAllCountries();
        }
    }
    

    }

Chapter7/serverAppSpec.js: e.cookies is not function

Chrome 43.0.2357 (Mac OS X 10.10.3) MainCtrl Server Calls should load items from server FAILED
TypeError: e.cookies is not a function
at n (Sites/sandbox/gitHub_basics/angular/angular.min.js:82:350) ...

Not sure why this error is happening, copied and pasted the example from gitHub and still get it :/

Readability of Chapter 11 is tough

I'm reading through AngularJS: Up and Running and am having to reread a lot of the material to follow your examples. I find that the code from example to example changes slightly and I'm having to study the code unnecessarily to see the changes. As a recommendation, I suggest you highlight changes in code, ie:

capture

Ch5 need-for-service

Hi, I feel strange of this example...

Why those items return to default when I change the tab?

After clicking the add function, the page's new Item add correctly, but if change the tab, and change back, everything gone! :-o!

ng-switch seems to create new scope every time!

Chapter 4 - select-example.html - wrong file on Git - i've appended the right file(i think : )) - thanks for this Great Book and Examples!!!

<title> Notes App </title>

What are your favorite sports?

With Binding:
Using ng-checked:
Current state: {{sport.selected}}
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.js" > 
</script> 
<script type= "text/javascript" > 
    angular.module('notesApp', []) 
    .controller('MainCtrl', [function ()  { 
        var  self  =  this ; 
        self.sports  =  [ 
            {label: 'Basketball', selected: 'YES'},
            {label: 'Cricket', selected: 'NO'},
            {label: 'Soccer', selected: 'NO'},
            {label: 'Swimming', selected: 'YES'}
        ];
    }]); 
</script> 
</body> 

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.