اشتراکها
یک نکتهی تکمیلی
به مستندات رسمی AngularJS 2.0، فصل جدیدی به نام «Introduction to Webpack» اضافه شدهاست. در اینجا میتوان Webpack را جایگزین Gulp کرد و نکتهی جالب آن، امکان نوشتن یک چنین کامپوننتهایی هستند:
در اینجا معرفی template و css جداگانهی تعریف شدهی در فایلهای مجزای خودشان، توسط متد require مربوط به webpack انجام شدهاند. مزیت آن این است که زمانیکه webpack کار bundling برنامه را انجام میدهد، تک فایل js حاصل، حاوی تمام فایلهای html و css برنامه هم خواهد بود و دیگر نیازی به توزیع جداگانهی آنها نیست. به عبارتی شما در حین تهیهی برنامه، inline کار نمیکنید، اما webpack آنها را حین توزیع نهایی، به صورت خودکار تبدیل به قالبها و شیوهنامههای inline میکند.
به مستندات رسمی AngularJS 2.0، فصل جدیدی به نام «Introduction to Webpack» اضافه شدهاست. در اینجا میتوان Webpack را جایگزین Gulp کرد و نکتهی جالب آن، امکان نوشتن یک چنین کامپوننتهایی هستند:
import { Component } from '@angular/core'; import '../../public/css/styles.css'; @Component({ selector: 'my-app', template: require('./app.component.html'), styles: [require('./app.component.css')] }) export class AppComponent { }
اشتراکها
ساخت tabs component در AngularJs 2
به نظر شما چه زمانی مناسب استفاده از vs2015 به همراه angularjs 2 در پروژهها میباشد؟
یک نکتهی تکمیلی
اگر میخواهید تمام مراحل ذکر شده را فقط با دو دستور ساده به پایان برسانید:
الف) ابتدا وابستگیهای nodejs را نصب کنید.
ب) سپس angular-cli را نصب کنید (اجرای دستور عمومی ذیل در خط فرمان):
ج) در آخر یک برنامهی جدید را شروع کنید (ابتدا از طریق خط فرمان به پوشهی مدنظر وارد شده و سپس دستور ذیل را صادر کنید):
اجرای همین چند مرحله، برای تشکیل قالب استاندارد شروع به کار با AngularJS 2.0 کفایت میکنند.
اگر میخواهید تمام مراحل ذکر شده را فقط با دو دستور ساده به پایان برسانید:
الف) ابتدا وابستگیهای nodejs را نصب کنید.
ب) سپس angular-cli را نصب کنید (اجرای دستور عمومی ذیل در خط فرمان):
npm install -g angular-cli
ng new AngularCLIDemoApp
Angular 2.0 will be built using the TypeScript language. It will embrace TypeScript's idioms for working with immersive web experiences in larger applications.
You can get those same benefits by working with TypeScript and Angular together. In this session, you'll learn how Angular and TypeScript work together to create single page applications. You'll see how you can leverage the features of ECMAScript 6, and still support today's browsers. You'll see how adopting TypeScript can be as easy as changing the extensions on your .js files. How you use the TypeScript features is completely in your control.
اشتراکها
کار با MySQL در برنامههای NET Core.
اشتراکها