การใช้ template แทน templateUrl

ไฟล์ .ts ปกติจะถูกสร้างมาพร้อมไฟล์ .html
โดยในไฟล์ .ts จะเรียกไฟล์ .html ด้วย templateUrl ดังนี้

แต่เราสามารถเปลี่ยนมาใช้ template แทนได้
โดยกำหนดโค๊ดที่ใช้แสดงผลให้กับตัวแปร template เลย เข่น

src/pages/home/home.ts

จากนั้นไฟล์ src/pages/home/home.html ก็ไม่ได้ใช้ละ ลบทิ้งได้เลย

แสดงปฏิทิน

1. สร้างแอพและรัน

[code]
> ionic start myCalendar blank
> cd ./myCalendar
> ionic serve -l
[/code]

2. เขียนโค๊ดแสดงปฏิทิน

src/pages/home/home.ts

src/pages/home/home.html

src/pages/home/home.scss

3. ติดตั้งและคอนฟิก Native Ionic Cordova Calendar Plugin

To integrate the calendar with native Ionic 3 Cordova calendar plugin, type this command to install it first.

[code]
> ionic cordova plugin add cordova-plugin-calendar
> npm install –save @ionic-native/calendar
[/code]

Now, open and edit src/app/app.module.ts then add this import.

บรรทัดที่ 10: import Calendar เข้ามาใช้
บรรทัดที่ 30: เพิ่มโมดูล Calendar เข้ามาใน @NgModule providers.

Now, it’s ready to implement in the pages.

3.

Link

แสดงอินพุท Date และ Time


home.ts

บรรทัดที่ 10-12: ประการศตัวแปร event ที่มีสมาชิกภายในเป็น date และ time

Note: จริงๆจะปรากาศตัวแปร date และ time แยกอิสระจากกันก็ได้ ไม่ต้องรวมกันไว้ใน ตัวแปร event

home.html

บรรทัดที่ 18: ผูกตัวแปร event.date เข้ากับ ion-datetime และกำหนดรูปแบบที่ใช้แสดง
บรรทัดที่ 23: ผูกตัวแปร event.time เข้ากับ ion-datetime และกำหนดรูปแบบที่ใช้แสดง

Link

ปัญหา SQL Server Configuration Manager not found

ปัญหา Microsoft SQL Server Configuration Manager not found ทั้งที่ติดตั้งแล้ว

ให้ไปเรียกใช้ตรงๆที่พาทตามนี้

SQL Server 2017
[code]
C:\Windows\SysWOW64\SQLServerManager14.msc
[/code]

SQL Server 2016
[code]
C:\Windows\SysWOW64\SQLServerManager13.msc
[/code]

SQL Server 2014
[code]
C:\Windows\SysWOW64\SQLServerManager12.msc
[/code]

SQL Server 2012
[code]
C:\Windows\SysWOW64\SQLServerManager11.msc
[/code]

SQL Server 2008
[code]
C:\Windows\SysWOW64\SQLServerManager10.msc
[/code]

Link

การเรียกใช้งาน Web Services ใน Visual Studio 2017

winform call web services

สร้างโปรเจ็กส์

File > New > Project…
เลือกโปรเจ็กส์แบบ Windows Classic Desktop > Windows Forms App (.NET Framework)
ตั้งชื่อโปรเจ็กส์ JackWinForm

เพิ่ม Web Services References

คลิกขวาที่ References > Add Service References…
ใส่ url ของ Web Services เช่น http://localhost:62668/MyWebService.asmx กด Go
เลือก MyWebService > MyWebServiceSoap
ตั้งชื่อ MyServiceReference

Continue reading

การสร้าง Web Services ใน Visual Studio 2017

Web Services

สร้างโปรเจ็กส์

File > New > Project…
เลือกโปรเจ็กส์แบบ Web > ASP.NET Web Application (.NET Framework)
ตั้งชื่อโปรเจ็กส์ JackWebServices
เลือก Empty

เพิ่มไฟล์ Web Services

คลิกขวาที่ JackWebServices เลือก Add > New Item…
เลือก Web Services (ASMX)
ตั้งชื่อไฟล์ MyWebService.asmx

Continue reading