Главная страница Случайная страница КАТЕГОРИИ: АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторикаСоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника |
Module 4: Modules, Routes and Factories ⇐ ПредыдущаяСтр 2 из 2
So a module can have something off of it called a config function, and it can be defined to use different routes. Now routes again are really important in the SPA world because if you have different views and those views need to be loaded into the shell page then we need a way to be able to track what route we’re on and what view that’s associated with and then what controller goes with that view and how we do all of that marrying together of these different pieces. Keep in mind you might actually have different views. You might have a mobile view, maybe one specific to iPad or Surface or something like that, and maybe have one for desktops. It’s very possible. So what we need to do is when we define our ng-app, earlier we didn’t assign it to anything, and so what that did was implicitly create a scope behind the scenes and it still worked we saw with the data binding and the filters and all that good stuff. We now want to graduate to a more modular application and Angular is very, very modular if you take advantage of it.
|