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 3

I posted the previous blog . Here is day 3: Make great thumbnails, 90% of the best-performing videos on YouTube have custom thumbnails. Attract more viewers and increase watch time by creating visually interesting, click-compelling thumbnails of your own. Day 3: Make great thumbnails, 90% of the best-performing videos on YouTube have custom thumbnails. Attract more viewers and increase watch time by creating visually interesting, click-compelling thumbnails of your own. ( time 15 mins, basic level) Subject read: Best practices: -Choose an image that describes your video. +Create thumbnails that accurately describe your video so viewers know what they’re about to watch. -Design an image that gets viewers to click. +For your audience, an eye-catching thumbnail can be the difference between choosing to watch a video or scrolling right past it -- so select images that will attract viewers. -Tell a cohesive story wity your thumbnail and title +When titles and thumbnails...