javascript - Initiating AngularJS -


i'm having issue getting started angularjs. have downloaded minified file , have living in js directory along app.js file. works until try calling app.js file. breaks. here's code.

index.html

<head>     <meta charset=utf-8 />     <meta name="description" content="description">     <title>my app</title>     <script src="js/angular.min.js"></script>     <script src="js/app.js"></script>     </head> <body ng-app>     <h1>intro data binding</h1>     <div ng-controller="dbcontroller">         <input type="text" ng-model="username" />         <p>hello, {{username}}.</p>     </div> </body> 

app.js

function dbcontroller($scope) {     $scope.username; } 

on body tag ng-app="app"

then, in .js file...

angular.module('app', []) .controller("dbcontroller", function($scope){     $scope.username = "my name"; }) 

it might helpful basic understanding of angular

the angular team provides lot of useful videos , other resources https://docs.angularjs.org/misc/started

free video tutorials: https://www.codeschool.com/courses/shaping-up-with-angular-js


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -