Skip to main content

learn angularjs at codeacademy

I learn angularjs and build some code from scratch. The first, it show up the skeleton of website structure.


wwwroot:
-CSS
++main.css                -->css how your website style
-IMG                         -->image for your website
++someIMG
-JS
++CONTROLLERs
++++maincontroller.js --->main controller
++SHARED                -->include angularjs support library
++++angular-mocks.js
++++angular-route.min.js
++++angular.min.js
++app.js            -->call into action
-INDEX.HTML--->the start point


Start point include 6 steps from introduction:
Awesome! You built an AngularJS app. How does it work?
  1. In app.js, we created a new module named myApp. A module contains the different components of an AngularJS app.
  2. Then, in index.html we added <body ng-app="myApp">. The ng-app is called a directive. It tells AngularJS that the myApp module will live within the <body> element, termed the application's scope. In other words, we used the ng-app directive to define the application scope.
  3. In MainController.js we created a new controller namedMainController. A controller manages the app's data. Here we use the property title to store a string, and attach it to $scope.
  4. Then, in index.html, we added<div class="main" ng-controller="MainController">. Likeng-appng-controller is a directive that defines the controller scope. This means that properties attached to $scope in MainControllerbecome available to use within <div class="main">.
  5. Inside <div class="main"> we accessed $scope.title using{{ title }}. This is called an expression. Expressions are used to display values on the page.
  6. The value of title showed up when we viewed the app in the browser.
  7. The same framework we can see there: the View-the Controller

Comments

Popular posts from this blog

YouTube Creator Academy-10 Fundamentals of a creative strategy in the course: Foundations for success boot camp-day2

YouTube Creator Academy-10 Fundamentals of a creative strategy in the course: Foundations for success boot camp-day2 Got a viral video that pulled 100,000 views? Great! But now what? Chances are, if the audience loved it, they’ll want more. Think beyond the one-video hit and consider developing a series of videos that are just as popular. Use these guidelines to test your ideas and give them the best chance of success on YouTube. BEST PRACTICES: -Shareability: Some ways to be shareable: Be topical:  When a story is breaking, join the conversation by crafting an episode around it. Be relatable:  Strike a chord with viewers on a subject they can relate to, whether it’s a broad topic like cell phone habits, or a niche topic like life in New York. Be valuable:  Try to provide practical value to the viewer. Tutorials rank among the most helpful, frequently used videos on YouTube. Be remarkable:  Upload a demonstration of exceptional talent or ability. -C...

YouTube Creator Academy-Your channel trailer in the course: Foundations for success boot camp- day 4

YouTube Creator Academy-Your channel trailer in the course: Foundations for success boot camp- day 4 First impressions matter. You can win the hearts of unsubscribed viewers with a captivating trailer. BEST PRACTICES: How can you turn viewers into subscribers? The first thing your unsubscribed viewer will see when they come to your channel is your channel trailer and channel description, so use them to hook in your viewers and turn them into subscribers. Remember, subscribers tend to watch more (which boosts watch time) so you want to make an awesome first impression when viewers first discover your channel. -Produce a captivating trailer: Your channel trailer is like a movie trailer - use it as a way to offer a preview of your channel's offerings so viewers will want to subscribe. What should go into it? Think about the unique qualities of your channel, your personality, and why viewers should feel compelled to return. There are many ways to make a channel trailer, but...

YouTube Creator Academy-Grow your audience boot camp-Day 1

I registered the "Grow your audience boot camp" event from youtube creator academy. The lesson is good for me to improve my youtube channel named " Explorer Mr Channel ". I take note  my study day by day. Hope this drive me to the top of the world. Here is the day first day I join the course. The recorder is started. steps 1: I register the course event in my youtube channel. The mail send to me after that. steps 2: Following the guide of the mail I come to the course and start at the newbie level. steps 3: I view and read the guide line of the lesson. steps 4: I answer the question and do some quiz. Day 1: Get discovered( time 15 mins, basic level) Subject read: Best practices-make the most of your metadata-Improve video discovery-Help suggest videos and craft engaging subscriber notifications. Get activities. Check your knowledge: Question 1: Why is it important to add appropriate metadata and not attempt to “game” YouTube’s search and discovery systems...